Skip to main content

Bug Tracker

Side navigation

#8 closed bug (fixed)

Opened June 16, 2006 01:00AM UTC

Closed July 15, 2007 04:14PM UTC

Last modified March 10, 2012 06:12AM UTC

Disabled attribute of input elements

Reported by: franck.marcia@gmail. Owned by:
Priority: major Milestone: 1.0
Component: core Version: 1.0
Keywords: Cc:
Blocked by: Blocking:
Description

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)
Attachments (0)
Change History (5)

Changed June 16, 2006 02:25AM UTC by john comment:1

resolution: → fixed
status: newclosed

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

Changed July 04, 2006 09:48PM UTC by john comment:2

milestone: → 1.0
version: → 1.0

Changed July 13, 2007 06:06PM UTC by randomperson comment:3

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','')"/>

Changed July 15, 2007 04:14PM UTC by john comment:4

description: 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)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)
need: → Review
resolution: → fixed
status: reopenedclosed

Changed May 19, 2011 12:42PM UTC by owais.iqbal@oneill.co.uk comment:5

IE7 gives error when disabling a drop down list.

$('select#country').attr('disabled', true);

or

$('select#country').attr('disabled', 'disabled');