Home › Forums › Backend Issues (wp-admin) › Updating image field with JavaScript › Reply To: Updating image field with JavaScript
I have an example that dynamically sets an image field here https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-fields-on-relationship. If you look in the JS file you will see what needs to be done. Basically you need to insert the image ID into the field, you need to set the src value of the image element and you need to add a class to the image container.
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.