Support

Account

Home Forums Add-ons Repeater Field Populate/recreate repeater by js/ajax

Helping

Populate/recreate repeater by js/ajax

  • I have a complex front/back-end form that I need to react to change in one multivalue Select2 field by recreating/populating a repeater field in another acf tab.
    The repeater needs to end up with the same number of rows as the Select2 holds values, so my plan of attack was to listen to Select2 change event, send values array to admin-ajax, update repeater with the new array of values, but I’ve stalled at the js update part as I don’t know what is the best way to update the front end form’s repeater by its underlying data that has changed in the meantime.

  • I have an example of dynamically populating a repeater that may help you here https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-repeater-on-category. It’s not exactly what you want, but it shows how to add rows to a repeater dynamically and how to populate a couple of text fields.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Populate/recreate repeater by js/ajax’ is closed to new replies.