Skip to main content

Bug Tracker

Side navigation

#1593 closed bug (wontfix)

Opened September 11, 2007 08:54PM UTC

Closed September 15, 2007 03:11AM UTC

Last modified November 26, 2007 01:58PM UTC

Serialize ignores buttons

Reported by: oridan Owned by:
Priority: major Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc:
Blocked by: Blocking:
Description

when specifically selecting a button and serializing it, it is no longer serialized properly, it used to give you:

buttonA=buttonValue

but it now returns an empty string.

Example:

<input id="buttonA" type='button' name="buttonA" value="buttonValue">
<script>
alert(jQuery("#buttonA").serialize());
</script>

Worked fine in 1.1.4, broken in 1.2

Attachments (0)
Change History (3)

Changed September 15, 2007 03:11AM UTC by john comment:1

resolution: → wontfix
status: newclosed

That's correct, we changed how serialization was done in 1.2 so that it will properly mimick how forms are actually serialized in a browser. We don't plan on reverting and making it invalid.

In the meantime you can just append the button name/value to the end of the string returned from serialize.

Changed September 15, 2007 08:34AM UTC by oridan comment:2

ahh yes, i see. It does make more sense that way, since clicking a "button" doesnt normally get serialised, only clicking a "submit".

Many Thanks,

Tom

Changed November 26, 2007 01:58PM UTC by umonkey comment:3

John, what do you mean by "making it invalid"? Gecko based browsers do submit the value of a button (checked with Firefox and Epiphany), Opera does so to, W3C says it should be so. It's the only way to make multi-button forms localized, not just a silly feature for fun. Only IE implements it unlike the rest, as usual.

I understand that the goal of jQuery is to work equally in all browsers, rather than being standard-compliant, but this argumentation ("making it invalid") still sucks. Browsers do submit button values, jQuery does not. This is invalid.