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.