Support

Account

Home Forums Front-end Issues Adding custom conditional logic to acf_form fields

Unread

Adding custom conditional logic to acf_form fields

  • I have an acf_form being used on the front-end of my website.
    One of the select fields is being populated programatically using the ‘acf/load_field’ filter and returns different values depending on the page the form appears on. Because of this i obviously can’t use the ‘Conditional Logic’ option when using the ACF UI as the select field doesn’t have any values at this stage.

    What is the best method for me to add the custom JS logic for this field? I can see ACF adds the data attribute ‘data-conditions’ to fields usually, as well as the ‘acf-hidden’ class.

    Should i be manually replicating this logic in JS or is there an easier way of going about it?

    Thanks

Viewing 1 post (of 1 total)

The topic ‘Adding custom conditional logic to acf_form fields’ is closed to new replies.