Home › Forums › Backend Issues (wp-admin) › Populate Text Fields on Select Field Change › Reply To: Populate Text Fields on Select Field Change
the only real difference between the JS for the repeater and the JS for the non-repeater fields is that on the repeater field I added
var $row = e.$el.closest('.acf-row');
and then each place where I need to get or set a value for a field $row.find()
is used instead of $()
Other than this the JS code from one to the other is pretty much identical and I’ve already built in the ability to use the “title” field on the repeater because I have a good feeling that the client will want this added once the see the draft of the site I’m building for them.
Hope it helps, there’s a bunch of extra code in there due to dealing with both a repeater and an non-repeater, but the code was just completed and tested today.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.