#8 closed bug (fixed)
Disabled attribute of input elements
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | major | Milestone: | 1.0 |
Component: | core | Version: | 1.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
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 (5)
comment:1 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 17 years ago by
Milestone: | → 1.0 |
---|---|
Version: | → 1.0 |
comment:3 Changed 16 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 16 years ago by
Description: | modified (diff) |
---|---|
need: | → Review |
Resolution: | → fixed |
Status: | reopened → closed |
I added information about this to the FAQ: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_disable.2Fenable_an_element.3F
comment:5 Changed 12 years ago by
IE7 gives error when disabling a drop down list. $('select#country').attr('disabled', true); or $('select#country').attr('disabled', 'disabled');
Thanks for the find, Frack - this has been fixed in SVN rev [81].