Form.request does not pass options to form.serialize
Reported by Ben Sommerville | May 1st, 2008 @ 09:18 AM | in 1.6.1
Form.request calls Form.serialize to get the parameters to post. However it does not pass serialize the options parameter it received. This makes it impossible to specify which submit button was pressed (using options.submit).
A fixed version of Form.request is below
request: function(form, options)
{
form = $(form),options = Object.clone(options || { });
var params = options.parameters, action = form.readAttribute('action') || '';
if (action.blank()) action = window.location.href;
options.hash = true;
options.parameters = form.serialize(options);
if (params)
{
if (Object.isString(params)) params = params.toQueryParams();
Object.extend(options.parameters, params);
}
if (form.hasAttribute('method') && !options.method)
options.method = form.method;
return new Ajax.Request(action, options);
}
Comments and changes to this ticket
-
Juriy Zaytsev May 1st, 2008 @ 06:59 PM
- → Milestone changed from to 1.6.0.3
- → State changed from new to bug
- → Assigned user changed from to Juriy Zaytsev
-
Tobie Langel May 2nd, 2008 @ 01:39 PM
- → State changed from bug to enhancement
-
-
jodosha May 28th, 2008 @ 12:14 AM
As suggested by John-David Dalton I improved my test, passing the second submit as parameter, not the default one.
-
Juriy Zaytsev May 28th, 2008 @ 05:52 PM
- → Assigned user changed from Juriy Zaytsev to John-David Dalton
-
Tobie Langel May 30th, 2008 @ 05:25 PM
- → Milestone changed from 1.6.0.3 to 1.6.1
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.
