Home › Forums › Backend Issues (wp-admin) › Fill fields after change value in another field › Reply To: Fill fields after change value in another field
You did not use the right hook to enqueue your script in the admin part.
The best way to do this when you are using ACF is to use the dedicated action.
Heres an example to enqueue a my.js file from <MY PLUGIN>/js
add_action( 'acf/input/admin_enqueue_scripts', function () {
wp_register_script( 'my-js', esc_url( plugins_url( '/js/my.js', __FILE__ ) ), false, false, true );
wp_enqueue_script( 'my-js' );
} );
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.