Reputation: 21631
First of all, I don't know why a disable control is still activating Javascript function. Now, I've added the below lines to check if the control is disabled, then just cancel the operation. IE9 is working, but Chrome and FireFox are not working.
var isDisabled = document.getElementById('contentMain__lnkDelete').getAttribute('disabled');
if (isDisabled == true) {
return false;
}
Upvotes: 0
Views: 1500
Reputation: 150253
Simply:
if (document.getElementById('contentMain__lnkDelete').disabled)
return false;
Or:
return !document.getElementById('contentMain__lnkDelete').disabled;
Upvotes: 1