Home › Forums › General Issues › Conditional Select Values with two selects › Reply To: Conditional Select Values with two selects
Yes it works – it works with a little bit knowledge using the perfect example from Hube – but it works also with standard ACF functions. You should use a standard select field with UI and AJAX activated. Your PHP action load_field should be set for this field and load the correct data. This is for both fields. Your second field should “hear” on $_POST[‘your_var_brand’] and then you should do a little bit work on your JS file…..
Have a look at the ACF JavaScript API documentation. The keyword should be:
acf.addFilter('select2_ajax_data', function( data, args, $input, field, instance )
I have used this in my actual plugin project in 15 fields and it works great.
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.