Make Form#serializeElements more accurate to the spec.
Reported by John-David Dalton | May 8th, 2008 @ 03:15 PM | in 1.6.1
As this page points out: http://www.malsup.com/jquery/for...
Prototype needs to follow the w3c spec a bit more: http://www.w3.org/TR/html401/int...
With recent commits we have ignored the file input elements, that's a start. http://github.com/sstephenson/pr...
We still need to ignore reset buttons and properly handle input type "image". We should also allow the "submit" option to be an element in case multiple buttons have the same name.
Background info: http://github.com/sstephenson/pr...
Comments and changes to this ticket
-
John-David Dalton October 5th, 2008 @ 07:50 PM
- → State changed from new to bug
- → Assigned user changed from to John-David Dalton
removed patch because it didn't follow the spec properly
-
Andrew Dupont May 8th, 2008 @ 05:35 PM
- → Milestone changed from to 1.6.1
-

Pradeep Elankumaran October 7th, 2008 @ 12:54 AM
- → Tag changed from to form needs_tests
serializing'a a text field with a value of "SOP's" does not encode the ' non-alphanumeric character. not sure if this has been fixed in trunk, but thought you guys might like to know.
-

Markus Brüderl October 8th, 2008 @ 01:10 PM
- → Tag cleared.
Having more input fields of type submit has one more flaw:
Passing parameters: $(formname).serialize({submit: buttonClicked})
where buttonClicked is the clicked Elements' name, the first submit-input field of the form would get postet also
A good behaviour would be: * none submit-option given - send only first submit input field * submit-option = false - dont send any submit fields * submit-option = name of clicked input field - send only this one input field
The second option currently doesnt work.
Fix: In form.js, line 15 if (value != null && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) {
remove the !submit||: if (value != null && (element.type != 'submit' || (!submitted && submit !== false && (key == submit) && (submitted = true)))) {
That works as described above.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
