Is there a where to update an image field with JavaScript by passing a media item ID (in wp-admin)? I.e. to mimic someone manually selecting a media item and load thumbnail etc.
Thanks.
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.
Thank you John this is very helpful. All the best.