Original Code
// disable
$("#btnSubmit").attr('disabled', 'disabled');// enable
$("#btnSubmit").attr('disabled', '');The above code worked in all major browsers until I upgraded to jQuery 1.6.2; however, after upgrading the element would not re-enable again by simply setting the disabled attribute to an empty string.
Solution
// disable
$("#btnSubmit").attr('disabled', 'disabled');// enable
$("#btnSubmit").removeAttr('disabled');Alternate Solution
// disable
$("#btnSubmit").attr('disabled', true);// enable
$("#btnSubmit").attr('disabled', false);I chose to go with the removeAttr solution since that seems more likely to eliminate differences from one browser to the next.
0 comments: