jQuery: The Write Less, Do More JavaScript Library

Ticket #1600 (closed bug: fixed)

Opened 11 months ago

Last modified 10 months ago

serializeArray returns incorrect val if value is array

Reported by: wizzud Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.1 Component: ajax
Version: 1.2 Keywords: serializearray
Cc: Needs: Review

Description

I believe there is a bug in serializeArray whereby using...

<select multiple="multiple" name="test[]">
    <option value="one" selected="selected">One</option>
    <option value="two">Two</option>
    <option value="three" selected="selected">Three</option>
</select>
$('select').serialize();

returns 'test[]=0&test[]=1' instead of 'test[]=one&test[]=three';

I think the problem is line 2094(ish)...

jQuery.map( val, function(i, val){

which should be...

jQuery.map( val, function(val, i){

Attachments

Change History

Changed 10 months ago by john

  • status changed from new to closed
  • resolution set to fixed

Fixed in SVN rev [3293].

Note: See TracTickets for help on using tickets.