Side navigation
#4013 closed bug (fixed)
Opened January 28, 2009 06:33PM UTC
Closed May 29, 2012 12:10AM UTC
: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.
Attachments (0)
Change History (8)
Changed January 29, 2009 02:39AM UTC by comment:1
Changed January 29, 2009 06:49PM UTC by comment:2
Thanks, dz. I will do that.
Changed June 18, 2009 05:05PM UTC by comment:3
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')
Changed November 09, 2010 08:05AM UTC by comment:5
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.
Changed July 11, 2011 06:17PM UTC by comment:6
priority: | high → low |
---|
Confirmed in bug triage.
Changed July 11, 2011 06:32PM UTC by comment:7
Test case: http://jsfiddle.net/cowboy/tRL92/
Changed May 29, 2012 12:10AM UTC by comment:8
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.