#120 ✓invalid
Andre Wolf

Form.serialize() resp. Hash.getQueryString() creates an extra "&"-characters for lists without selection

Reported by Andre Wolf | May 27th, 2008 @ 03:25 PM

I have a form which contains multi-select lists. If I haven't selected any values in such a list, Form.serialize() does not create an query parameter for it but it always adds an additional ampersand to the query string. With a larger number of parameters, the query string contains two consecutive ampersands, e.g "param1=val1&¶m3=val3". If I pass this query string as Ajax request to a Tomcat server I get countless unnecessary warnings in the server log:

27.05.2008 14:55:28 org.apache.tomcat.util.http.Parameters processParameters

WARNING: Parameters: Invalid chunk ignored.

The base problem seems to be in Hash.getQueryString(). I get the same incorrect query string when I use the following statement:

$H({param1:'val1', param2:[], param3:['val3']}).toQueryString()

-> "param1=val1&¶m3=val3"

Tested with Prototype 1.6.0.2, Firefox 2.0.0.14, Firebug 1.05

Comments and changes to this ticket

  • John-David Dalton

    John-David Dalton May 27th, 2008 @ 05:04 PM

    • State changed from “new” to “invalid”

    Thank you for reporting this bug.

    This problem has been resolved in the current git repo of Prototype :)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

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.

Shared Ticket Bins

People watching this ticket

Pages