Bug Tracker

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#6591 closed bug (duplicate)

":enabled" pseudo-selector is wrong

Reported by: diyism Owned by:
Priority: undecided Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:

Description

alert($("[name=CreativeID[]]").length);get 6 alert($("[name=CreativeID[]]:disabled").length);get 2

alert($("[name=CreativeID[]]:enabled").length);get 0

it should get 4

Change History (5)

comment:1 Changed 9 years ago by diyism

alert($("[name=CreativeID[]]:not(:disabled)").length); get 4

comment:2 Changed 9 years ago by diyism

In my mind, it should be take as "enabled", because its value will be send to the server: <input type="hidden" value="1" name="CreativeID[]">

comment:3 Changed 9 years ago by diyism

For reference, from the HTML 4 spec:

"DISABLED attribute, also new in HTML 4.0, disables the control. Disabled elements are read-only elements with the added restrictions that the values are not submitted with the form, the elements cannot receive focus, and the elements are skipped when navigating the document by tabbing."

Perhaps the most intuitive behavior would be if the ":enabled", ":disabled" selectors selected elements directly corresponding to whether the disabled attribute is set, and nothing more.

quoted from:

http://old.nabble.com/Selector-:enabled-no-longer-finds-hidden-elements-td21734256s27240.html

comment:4 Changed 8 years ago by snover

Priority: undecided
Resolution: duplicate
Status: newclosed
Summary: ":enabled" is not working correctly":enabled" pseudo-selector is wrong

Workaround: Use

comment:5 Changed 8 years ago by snover

Duplicate of #4013.

Note: See TracTickets for help on using tickets.