PDA

View Full Version : Javascript onChange doesn't work when changed buy another script



Magiccupcake
13 Jun 2011, 04:00 PM
I have some javascript that runs when a user checks/unchecks a checkbox, and that works fine. I also have some javascript that will uncheck all boxes if a user changes a dropdown menu, that works fine as well. But the problem is I need the script to run as if each of the checkboxes was clicked when the second script runs. Is there a simple way of doing that? like change onChange=""; to something else, or do I actually need to do something to my code?

Any help is appreciated.

Xandor
15 Jun 2011, 09:50 AM
I assume your script that unchecks everything simply iterates through all checkboxes, you could simply call the same callback as onChange inside the iterating loop and thus it would get called for each box. If desired you could even add in an if statement that would only run the callback if it was actually changed. Hope this helps.