Home › Forums › ACF PRO › Repopulate & change on ACF frontend form's Select2 › Reply To: Repopulate & change on ACF frontend form's Select2
In the end I found the ‘data’ argument of select2 method.
So i did this:
$acf_row.find(‘[data-name=”sq_solution_features”] input[type=”hidden”]’).select2(‘data’, new_select2_data);
new_select2_data should be array of objects {id: id, name: name}
And it seems to work and persist through form submits.
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.