Support

Account

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”?