Support

Account

Home Forums Gutenberg Saving field updated via AJAX

Solved

Saving field updated via AJAX

    • bpdp

    • September 20, 2019 at 5:29 am

    Hello All,
    I have an ACF block with a couple text fields, several of which get populated via ajax. If I manually fill in all the required fields and let the ajax fields populate themselves I’m left with a perfect block full of input that I want to save. problem is when I click the update button and refresh my page the fields populated by ajax do not save. I’m assuming that I need to tell wordpress that these ajax fields need to be saved, but I have no idea what I need to do. any help would be appreciated. thanks!

    • bpdp

    • September 21, 2019 at 4:13 am

    adding .trigger("change"); seems to have solved the problem.

    final code:

    $(address_field).val(obj.address).trigger("change");

    Thanks

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.