Hi
I’m trying to find out (with no luck) how do I get a function to run when a new line is created by the ‘add’ button on the repeater.
I created a field which runs a script to mask it, but then inside the repeater this script is not run.
Any correct way to proceed?
in a javascript file you can add this code to run when a row is added to the repeater field
(function( $ ) {
$(".acf-input .acf-repeater").on('click a[data-event="add-row"]', function(evt, el){
console.log(evt);
});
})( jQuery );
See the actions section of the JS API doc https://www.advancedcustomfields.com/resources/javascript-api/#actions. The append action is fired when a new row is added.