I need to be able to enable and disable a linkbutton using javascript as part of a custom validator that I’m writing.
I discovered that setting “disabled=true” will disable a standard button, but it does nothing to a linkbutton.
After mucking about in JQuery I discovered that the following will actually disable the button:
$(button).click( function() { return false; }
Where button is a reference to the object. That works well. However, I can’t for the life of me work out how to re-enable it! Neither of these seem to work:
$(button).click( function() { return true; }
$(button).click( function() { }
If anyone could either point me in the right direction to re-enable my button, or suggest a better way of disabling the button, It’d be appreciated.
Chers,
Matt
I think you have to unbind the first event first.
Don’t know in other versions, but in 1.4.2 you can attach multiple events, so the behaviour when you do this
will be ‘return false;return true;’