Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13330 closed feature (notabug)

.serialize() doesn't include <output> fields from a form (new in HTML 5)

Reported by: White Glove Apps <[email protected]…> Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:

Description

With the addition of <output> fields for forms in HTML5, it would be beneficial to have .serialize() include them (perhaps optionally) when applied to a form. For example, the developer might want to collect usage data to improve the user experience, and collecting the <output> field values would be useful.

For an example, see http://jsfiddle.net/jemonat/9KJCb/. There, $('#myform').serialize() only includes input fields, not <output> fields.

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

See #10443. The updated link for the spec is

http://www.w3.org/TR/html5/forms.html#constructing-form-data-set

We're following spec here. The HTML5 spec doesn't consider <output> to be a submittable element, which does make sense because it's calculated, so we wouldn't want to include it. If you had a situation where you wanted to include it you can do it manually.

comment:2 Changed 10 years ago by White Glove Apps <[email protected]…>

OK, thanks! I've included the output fields manually for my page; just thought it might be helpful to let developers decide if they want to include output fields in .serialize(). I understand the logic of following the HTML5 spec for what elements are submittable.

Note: See TracTickets for help on using tickets.