Home Forums ACF PRO Hide and show ACF Group


Hide and show ACF Group

  • Hi. This is in regards to frontend submission forms.

    As I understand it you can’t create conditional logic based on taxonomy (only checkboxes).

    What I am thinking of doing is have multiple forms by group ID that are hidden on a template page. I tested and it looks like you can display multiple templates by acf_form. Each one of these forms have different fields depending on what category a person chooses.

    Then I would have some sort input menu (representing a category) that would show and hide these forms via jquery. Wondering if anybody would recommend a better way to do this or I am on the right track?

  • You could add all the forms as you said, but in the ACF admin screen, you can apply classes to each form field. If you add unique classes each form element in each form group, you could use JS or just CSS to hide and show the different forms.

    Is that the sort of thing you need to do?

  • I’d say you’re on the right track. You need to create a separate select field that in not part of any of the acf forms. Then when a value is selected it triggers a JavaScript function that shows/hides forms based on the selection. You could also incorporate the previous comment and set the forms to show and hide by changing the class of the containers for each form.

  • I’ve needed this as well, so I created a custom field setting which allows for conditional logic based on taxonomy. Give it a try when you get a chance.

    ACF Conditional Logic Advanced

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Hide and show ACF Group’ is closed to new replies.