Home › Forums › ACF PRO › Frontend form with location rules › Reply To: Frontend form with location rules
This won’t work on the front end. In the back end when you select a category in the standard WP category box this triggers WP to run AJAX to see if there are more field groups that need to be displayed. This will not work on the front end because ACF does not update the taxonomy field until you save the post. You would basically need to create a location rule that’s based on the value of an ACF field and that functionality does not exist.
It is something that can be done. I don’t know of any examples of how to do this with a taxonomy field, but this JavaScript is an example of how to do it with an ACF choice field and with some work you could probably make make it work with a taxonomy field. https://github.com/Hube2/acf-custom-field-locations-rule/blob/master/acf-custom-field-location-rule.js
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.