Home › Forums › Backend Issues (wp-admin) › List of JS hooks › Reply To: List of JS hooks
Sure
var imageInputOnChange = function ($input) {
// This is the only way to check what field has been changed.
if ($input.context.name !== 'acf[field_56d99d7de115e]') {
return;
}
// Finding the image requires DOM traversing
var $image = $input.closest('.acf-image-uploader').find('img');
// Do something when the uploaded image is fully loaded
$image.on('load', imageOnLoad);
};
var imageOnLoad = function (image) {
// Do something...
};
acf.add_action('change', imageInputOnChange);
So as you can see using this hook requires some additional effort to determine which field’s value was changed. That’s why I’ve posted this request.
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.