Reputation: 6752
I have an ASP.NET control that outputs a button to the screen and I have no way of modifying that button in the server side.
The button renders with some functions in the onclick event and I need to disable the button after it has been clicked.
I've decided to use jQuery and append the javascript to disable the button on the onclick event. The problem is that by doing so I am also removing the original click event. Here's the code i'm using.
$(":submit[value='Finish']").click( function(event) {
$(this).attr("disabled", true);
} );
How can I append to the click event instead of replace it?
Thanks...
Upvotes: 0
Views: 96
Reputation: 163238
var func = obj.onclick; //get reference to original click handler
obj.onclick = function() {
func(); //call the original click handler
//do stuff...
};
Upvotes: 2