There is an old post by the developer that gives some basics on adding conditional logic here http://www.elliotcondon.com/conditional-logic-for-advanced-custom-fields/ and there is additional information posted by another user here https://support.advancedcustomfields.com/forums/topic/conditional-logic-across-field-groups/
some other things to look out for. ACF5 uses field keys rather than field names so for example instead of using
$('#acf-hero_image, #acf-hero_video, #acf-hero_slider').hide();
you’d use something like this
$('#acf-field_01234567890123, #field_01234567890123, #field_01234567890123').hide();
Also, if you’re looking to show and hide entire field groups, which it appears that you are trying to do, I have built a plugin that creates location rules based on choice fields that can be found here https://github.com/Hube2/acf-custom-field-locations-rule. Even if you don’t use the plugin you can see how to make this work by looking at my code.
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!
© 2022 Advanced Custom Fields.