Home › Forums › Backend Issues (wp-admin) › Custom location rule JS refresh › Reply To: Custom location rule JS refresh
I can’t say if this will get you in the right direction or not. I have created a plugin that lets you set location rules by select fields in other field groups. When it came to the JS part of it what I did was to extend the ACF AJAX to add my own and to trigger the updated. You can see this here https://github.com/Hube2/acf-custom-field-locations-rule/blob/master/acf-custom-field-location-rule.js.
Like I said, this extends acf.ajax. What it does is that it gets the value for a field and then triggers ACF to refresh (fetch) the field groups. There shouldn’t be any reason that you couldn’t do this with fields outside of ACF as will.
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!
🗓️ Just one more day until the next session of ACF Chat Fridays! Make sure to register for the latest updates on what’s coming in ACF 6.1!— Advanced Custom Fields (@wp_acf) March 30, 2023
📆 Friday 31st March 3pm UTC
👉 Register here - https://t.co/3UtvQbDwNm pic.twitter.com/7xtEJakeQN
© 2023 Advanced Custom Fields.