Home › Forums › Backend Issues (wp-admin) › Get the saved value from a dynamically loaded Select field using JavaScript API › Reply To: Get the saved value from a dynamically loaded Select field using JavaScript API
The field definition really won’t help me.
When you make the AJAX request you need to send the current post ID as well as any other data you’ll need to get the current value to be returned.
Another alternative is to also use an acf/prepare_field filter to also set the choices in PHP. If you do this then ACF will set the selected value. You can then get the selected value before updating the choices using JS and then reset the selected value after.
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.