I created a field “client” with the wp users.
In my admin page i’d need to listen to on change on this drop down.
This is what i tried but no effect…
ok it works with this below, could you please now have a look at my second question please ? thanks
In fact , more generally this is my case :
I created a custom post type and added the ACF fields in the admin post page.
My first ACF fiels is a WP User Dropdown, and when loading page or changing value in drop down list i need to update all fiels that depends on $user_id
The walkthrough to follow.
– get the user ID (there are functions to do that)
– add it to the ACF ajax query.
For the other fields depending on user ID value :
On PHP you should use query filters (there are some for taxs, posts, relations)
– get the $_POST[ID] (added by JS before)
– use it.
When you load the page (ie for an update) , $_POST[ID] does not exist but you can use get_field if you need to use your query filters with user ID
The topic ‘OnChange Select DropDown’ is closed to new replies.
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!
© 2021 Advanced Custom Fields. Subscribe