[jQuery] Allow onclick (etc) on disabled input

[jQuery] Allow onclick (etc) on disabled input


I have discovered that if an input is disabled all its events are as well.
For example
<input type="text" disabled="disabled" onclick="alert('x');" />
won't work.
I have an input like this and want it disabled (to prevent it being posted)
unless the user wants to change the value.
I thought I could simple use
<input type="text" disabled="disabled"
onclick="$(this).removeAttr('disabled');" />
or it might need
<input type="text" disabled="disabled" id="x"
onclick="$('#x').removeAttr('disabled');" />
But alas, no luck.
Is there some way to force an onclick to work in this situation?
--
View this message in context: http://www.nabble.com/Allow-onclick-%28etc%29-on-disabled-input-tf2594290.html#a7235760
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/