Home › Forums › Front-end Issues › Detect if a field is changed? › Reply To: Detect if a field is changed?
Hi,
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!
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.