Is there a way to detect a change to a repeater field in javascript? Maybe an event I can listen for?
There is a way to add an action to a sub field of a repeater field.
The exact jQuery selector you’d use would depend on what type of sub field is involved.
I have several examples adding actions to acf fields in this repo https://github.com/Hube2/acf-dynamic-ajax-select-example including one that adds an action to a true/false field that is a sub field of a repeater https://github.com/Hube2/acf-dynamic-ajax-select-example/blob/master/unique-repeater-checkbox/unique-repeater-checkbox.js
I’m sure there are other ways to add actions other than the way I do it, but it’s what I’m used to.
Do you know if there’s an event for adding a new repeater item? i tried just adding it to the click event on the button but it runs before the item is added.
Do you want to detect a new repeater item being added or do you want to add an new repeater item from JS?
Bump. Is there a way to detect new items being added in js?
This is a very old topic, since the OP ACF has added a JS API, see the “append” action.