Ticket #8 (closed bug: fixed)
Disabled attribute of input elements
| Reported by: | franck.marcia@… | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | core | Version: | 1.0 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description (last modified by john) (diff)
When you want to enable a disabled element with $(element).set('disabled', false), it fails.
In $.attr, "o[a] = v" does the job but "o.setAttribute(a,v)" reverts disabled to true.
- Failure only with FF (works fine with IE) on WinXP.
- Test case: http://fmarcia.info/jquery/disabled
- Workaround: use $(element).get(0).disabled = false (or each() if several elements are involved)
Change History
comment:3 Changed 6 years ago by randomperson
- Status changed from closed to reopened
- Resolution fixed deleted
Maybe I misunderstand what was trying to be conveyed, but using his example with the current version of jQuery (1.1.3.1) is still broken with Firefox 2.0.0.4 on XP. So, the first two sets of buttons do not work, while the third set (his workaround) works. Also, you could add the following to his example as workarounds that work:
<input type="button" value="Disable" onclick="$('#x').attr('disabled','disabled')"/>
<input type="button" value="Enable" onclick="$('#x').attr('disabled','')"/>
comment:4 Changed 6 years ago by john
- need set to Review
- Status changed from reopened to closed
- Resolution set to fixed
- Description modified (diff)
I added information about this to the FAQ: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_disable.2Fenable_an_element.3F
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Thanks for the find, Frack - this has been fixed in SVN rev [81].