Skip to content

Document that .serialize() should only be run on forms, and not fieldsets #108

@mikesherov

Description

@mikesherov

http://bugs.jquery.com/ticket/11594

from @dmethvin:

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.

from @ajpiano:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions