[jQuery] Allow onclick (etc) on disabled input

2006-11-08 Thread jazzle
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

Re: [jQuery] Allow onclick (etc) on disabled input

2006-11-08 Thread jazzle
Sorry for ~spam, I found that adding the onclick to the parent element (a TD fortunately) is a good enough solution in this situation. BTW: The behaviour is slightly different in IE7 vs Fx2: in IE the click passes through the input, but in Fx the click must be in the TD, outside the input.

Re: [jQuery] Allow onclick (etc) on disabled input

2006-11-08 Thread Brian Miller
One thing you can do is not use disabled at all. If you decorate the control like it's disabled, and leave it with an ID (so jquery can find it) but no name, it will be an unsuccessful control, and won't send. If someone enters something in the field, you can use $('myinput').attr('name',

Re: [jQuery] Allow onclick (etc) on disabled input

2006-11-08 Thread Mike Alsup
If you decorate the control like it's disabled, and leave it with an ID (so jquery can find it) but no name, it will be an unsuccessful control, and won't send. If someone enters something in the field, you can use $('myinput').attr('name', 'myinput') to add the name attribute. Nice idea,