Home Forums Front-end Issues ACF Form Repeater Populate


ACF Form Repeater Populate

  • Greetings all!

    I’m rendering a form on a page and I need to populate a repeater field with localStorage data.
    What’s the best approach to achieve this?


  • Hi @bmds,

    Since localstorage is Javascript-based you don’t really have much choice but to read the localstorage data and create new rows and insert the values.

    Since it’ll be very hard for you to replicate how the rows are structured I’d recommend just triggering the “add row” button with JS thus letting ACF do the creation.

    Something like:

    jQuery('.acf-repeater-add-row').trigger('click', function(){
    //Delay a function a few hundred millseconds to give ACF time to create the row then do your own insertion. Preferably via function call
    function insertLocalstorageData(){
    //Do stuff!
  • Hi @jonathan!

    Thanks for your help.
    That is what I had in mind and I did look at “acf-pro-input.js” trying to understand how to trigger the click.
    I’ve tried this in the console for a quick test but no rows are added



  • Did some research and this works


    Thank you!

  • You’re welcome and good luck!

    My guess is that there’s more elements using the same class but perhaps only one link. So this might work too

    Just as a note 🙂

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

The topic ‘ACF Form Repeater Populate’ is closed to new replies.