Home › Forums › Add-ons › Repeater Field › Repeater Row Values Via Javascript › Reply To: Repeater Row Values Via Javascript
Needed this today and stumbled on this post.
I’m dynamically changing things via select2_ajax_data
based on other field values, so I needed the value of a different field in a repeater row.
This is the idea. Works well enough.
// $input is coming from select2_ajax_data filter,
// so it's the current field input.
var fields = acf.getFields(
{
key: 'my_field_key',
parent: $input.parents( '.acf-row' ),
}
);
if ( fields ) {
var value = fields.shift().val();
}
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.