Opened 14 years ago
Closed 11 years ago
#4013 closed bug (fixed)
:enabled no longer finds hidden elements
Reported by: | krallja | Owned by: | john |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | selector | Version: | 1.4.4rc |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
A form element with <item type="hidden"> will POST with those hidden elements as request variables. Filtering on $(":enabled", theForm) will only find VISIBLE enabled elements, which is changed since jQuery 1.2.6. There is now no easy way to serialize a form in the same manner that the browser would submit it.
Change History (8)
comment:1 Changed 14 years ago by
comment:3 Changed 14 years ago by
For info the discussion is here: http://groups.google.com/group/jquery-dev/browse_thread/thread/20f145cc3e48bb43/1fbb78d0a65b9227
Result is that this behaviour is consistent with browser implementations of querySelectorAll()
The documentation needs to be updated at it is not clear.
The best way to get all enabled inputs including type=hidden is to use .not(':disabled')
comment:5 Changed 13 years ago by
Milestone: | 1.3.2 → 1.4.5 |
---|---|
Priority: | major → high |
Status: | new → open |
Version: | 1.3.1 → 1.4.4rc |
Sizzle is doing this wrong. No current browsers implement this pseudo-selector the way it does. test case
In browsers that support qSA the results are correct. In browsers that do not support qSA (IE7), $(':enabled')
returns 13 and $('input:enabled')
returns 0. They should both return 1.
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
From the jQuery 1.3.1 source:
So it looks intentional. If you have questions about the behavior, and if you want to inquire about reverting it to 1.2.6 behavior or for possible alternates, try emailing the jquery-dev mailing list.