#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 13 years ago by
comment:2 Changed 13 years ago by
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 13 years ago by
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 12 years ago by
Priority: | → undecided |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Summary: | ":enabled" is not working correctly → ":enabled" pseudo-selector is wrong |
Workaround: Use
alert($("[name=CreativeID[]]:not(:disabled)").length); get 4