I have a function that I'm using to prevent multiple postbacks of a form:
var submitted = false;
$(function() {
$('form').bind('submit', function(e) {
if (!submitted && CanSubmit(e)) {
submitted = true;
return true;
} else {
return false;
}
});
});
In the CanSubmit
method, I need to interrogate the button that was clicked to determine whether I should allow the submit or not.
Note that I can't bind to specific click events - see this previous question for more details.
In Firefox, I can use e.originalEvent.explicitOriginalTarget
, but this is apparently not available in IE.
How can I get this value from the e
parameter in a cross-browser way?