Home › Forums › Front-end Issues › Detect if a field is changed? › Reply To: Detect if a field is changed?
I am messing with ACF and some JS to make calculations based on my inputs. I struggle with the switch fields.
Basically I need to detect if a switch input is on and make a different calculation if it is. For now I rely on checking the parent of the input which receives a “-on” class when turned on, but that’s about it.
The problem is that by firing the function on “change”, the calculation gets made first and then the switch input gets the class on. Is there a way to change the priority of my function, so that it fires right after the other Jquery functions that add the class “-on”?
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!
The new features in ACF 6.1 mean we’ve nearly doubled the number of translatable strings, and we need help translating them into your language. See how translations are progressing and how you can help at the link below. https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 17, 2023
© 2023 Advanced Custom Fields.