Bug Tracker

Modify

Ticket #6591 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

":enabled" pseudo-selector is wrong

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

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

comment:1 Changed 3 years ago by diyism

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

comment:2 Changed 3 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 3 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 3 years ago by snover

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to duplicate
  • Summary changed from ":enabled" is not working correctly to ":enabled" pseudo-selector is wrong

Workaround: Use

comment:5 Changed 3 years ago by snover

Duplicate of #4013.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.