I have HTML input and button elements. I use the buttons to submit forms, open secondary windows, etc. The problem is, a single click is turning into 2 (and sometimes many more) form submissions, or opening two additional browser windows. I've reproduced the problem in multiple web browsers. I've tried switching jQuery versions and that didn't change anything. What could be causing this sort of thing to happen?
Your problem may be happening because you are assigning the same handler to the click event multiple times. I suggest you check that the line where you assign the handler is not being called multiple times inadvertently. Another solution could be a call to unbind
(deprecated 3.0) or off
(superseeded) first:
$("#myButton").unbind("click").click(myHandler); // deprecated $("#myButton").off("click").click(myHandler); // superseeded
But without seeing some code I'm just guessing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With