#11594 closed bug (wontfix)
Serialize fieldset in Chrome and IE9
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | ajax | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
.serialize() does not serialize form elements inside a fieldset in Chrome or IE9.
A test case is provided at http://jsfiddle.net/HQZts/
To reproduce the issue, open the above test case in the following browsers: Firefox, Chrome, and IE 9.
fails: Chrome and IE 9 on Windows 7 64-bit
works: Firefox on Windows 7 64-bit
Change History (5)
comment:1 Changed 11 years ago by
Owner: | set to jragsdale@… |
---|---|
Status: | new → pending |
comment:2 Changed 11 years ago by
Status: | pending → new |
---|
I want to save bandwidth by sending only a subset of a form in certain cases. Likely, there are workarounds where I can use nested forms to get my desired results.
In the first paragraph of the documentation, there is a sentence that reads, "It operates on a jQuery object representing a set of form elements." A fieldset can contain form elements, thus the confusion.
I am not the first to encounter similar confusion:
http://bugs.jquery.com/ticket/9863
http://stackoverflow.com/questions/8166991/jquery-serialize-and-serializearray-is-not-working-with-google-chrome
Simplest solution is to make the documentation more clearly express the limitations of .serialize() on elements other than the root form.
comment:3 Changed 11 years ago by
Keywords: | needsdocs added |
---|
I don't think adding a note about using it on fieldsets is a terrible idea, so +1 for that. This could perhaps be phased in terms of explaining that "a collection that contains an element that contains form elements is not the same as a collection that contains form elements." Using the word "represent" is probably misleading here.
But in terms of workarounds, I just thought it's worth noting that $("#someFieldset :input").serialize() is probably a wiser move than nested forms, etc, so I wanted to chime in with that.
comment:4 Changed 11 years ago by
Component: | unfiled → ajax |
---|---|
Priority: | undecided → low |
Resolution: | → wontfix |
Status: | new → closed |
Closing this as wontfix, docs pending.
comment:5 Changed 11 years ago by
Keywords: | needsdocs removed |
---|
It doesn't seem like this is a documented use of the method.
So other than a form, there is no current use of
.serialize()
that requires the code to search inside an element for more elements to process.Is there some documentation that implied it was correct to use a fieldset like this? At best I'd consider it an enhancement request and not a bug, but I'd prefer to just clarify the docs. It's easy to change the selector to get your desired effect.