Hooking up an Event Prevents Bubbling?
I am using the following script to prevent users from clicking more
than once on any given page button:
$(document).ready(function() {
$("input.button").click(function() {
$("input.button").attr("disabled", "disabled");
return true;
});
});
The issue is that it's preventing the clicked button's other actions
from taking place. I'm thinking it could be one of two things:
1) Disabling the button actually prevents the event from firing since
the button that fires it is "disabled" -- but I don't think this is
it, because by the time the button is disabled it has already fired
2) The jquery event itself it preventing other events from firing. I
remember something about returning false when clicking a link that is
only supposed to preform some behavior and not actually follow its
href, so in the same vein I made the function above return true, but
it had no effect on the behavior. What happens is that the button is
pressed (this is a ASP.NET application by the way), all buttons are
disabled per the fucntion above, the page posts back, and nothing has
happened. It's supposed to post back, having performed its action,
which it was doing before jquery hooked up the event.
CAn someone shed some light on this problem for me? Thanks!
-Pete