I have two select menus being dynamically populated. I’d like to change the values of the second select menu based on whatever is selected in the first menu.
Menu one has car brands
Menu Two is the type of car.
If they select Ford in the first menu, i’d like the second menu to show options as F150, Fusion.
But if they select Toyota, the second menu should show Prius, Highlander, etc.
I’m using ACF Pro and i’m not sure i see anything in the documentation that allows me to do this
There isn’t a lot of documentation or useful examples of doing what you want. I have created an example of how to do something similar to this, my example draws it’s information from post types, but it can be changed to other sources of information. The important part of the example is the JS code that gets the value from one field when it’s changed and hooks into the ACF ajax code to get the results to populate another select field with. Hope it helps https://github.com/Hube2/acf-dynamic-ajax-select-example/tree/master/dynamic-select-example
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users