I am trying to get some customer support to solve this, but yet no luck as they keep providing the code above, that is attached to the php function handling the ajax call, the one that generates the acf form. But it is still not working.
Media upload fields, WYSIWYG, conditional logic and repeater (I guess any field that requires some sort of JS initialization) are not working properly if the form is generated via ajax. For example I still get this simple error for media fields, which clearly indicates that js snippet they are providing is not initializating the media field correctly:
TypeError: wp.media is undefined
xxx.xxx.xxx/wp-content/plugins/advanced-custom-fields-pro/js/input.min.js?ver=5.0.9 line 1
I wonder if someone out there has managed to do this really essential thing, as for all the people out there using ajax to generate forms this is very much needed, and if this is impossible to do with acf, please I encourage acf team to state it clearly in the features before people waste their money and time on this and can give a try to other plugins for front-end edition via ajax.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!