#1384 ✓ resolved
Adam Heurlin

Form.serializeElements does not consider <select multiple>, fails

Reported by Adam Heurlin | September 18th, 2012 @ 05:08 PM

If Form.serializeElements is given a <select> with the multiple attribute set, an error is thrown on line 5809, on

    value = value.gsub(/(\r)?\n/, '\r\n');

The accumulator expects value to be a String, but is given an array of strings representing the selected values in the <select multiple>.

Similarly, if options.hash is true, then the hash accumulator adds the entire array to the result object, which means you may end up with objects like this:

    {
        "foo": ["bar" /* from some other form element */, ["baz", "quz" /* from <select multiple> */]]
    }

This is probably not intended behaviour. :)

Comments and changes to this ticket

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

Attachments