Support

Account

Home Forums Front-end Issues Adding a sub field to a repeater with JavaScript Reply To: Adding a sub field to a repeater with JavaScript

  • @christian-denatorange-fr Your code should work when the repeater field is used as a flexible content?

    In my case, I have a layout with a selector and a repeater:

    acf.addAction('new_field/name=preset', foo);
    
    function foo(field) {
      field.on('change', function() {
        const repeater = acf.getField('field_page-builder_sections_row-module_row_columns');
        let $row = '';
        $row = repeater.add();
      });
    }

    But nothing happens.