Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 8 years ago

#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:
Blocked by: Blocking:

Description (last modified by john)

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.
  • Workaround: use $(element).get(0).disabled = false (or each() if several elements are involved)

Change History (5)

comment:1 Changed 13 years ago by john

Resolution: fixed
Status: newclosed

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

comment:2 Changed 13 years ago by john

Milestone: 1.0
Version: 1.0

comment:3 Changed 12 years ago by randomperson

Resolution: fixed
Status: closedreopened

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 12 years ago by john

Description: modified (diff)
need: Review
Resolution: fixed
Status: reopenedclosed

comment:5 Changed 9 years ago by owais.iqbal@…

IE7 gives error when disabling a drop down list. $('select#country').attr('disabled', true); or $('select#country').attr('disabled', 'disabled');

Note: See TracTickets for help on using tickets.