Skip to main content

Bug Tracker

Side navigation

#3965 closed bug (fixed)

Opened January 22, 2009 08:22PM UTC

Closed April 17, 2011 05:23PM UTC

serialize bug in IE

Reported by: jehinkle Owned by:
Priority: low Milestone: 1.4.4
Component: ajax Version: 1.3.1
Keywords: serialize ajaxrewrite expando Cc:
Blocked by: Blocking:
Description

when using .serialize(), if any input in your selection has an ID of 'length', serialize() will return a null value.

Attached is a simple demo of the issue. Run the html file in IE 7 and you will get an alert box with a no message. Rename the input to anything other than 'length' and it will alert the serialized string. No issues when running the page in FireFox

Attachments (1)
  • demo.htm (0.3 KB) - added by jehinkle January 22, 2009 08:22PM UTC.

    demo of bug

Change History (6)

Changed January 30, 2009 02:24AM UTC by dmethvin comment:1

This fails in IE8 RC1 as well. The problem occurs in

jQuery.makeArray
. It is passed the form's elements collection and tries to get the length property, but ends up getting the input element with id="length" instead. As a result it doesn't return an array with the form elements.

This case even confuses the IE8 debugger! At the top of makeArray it shows the array.length==2 in the debugger, but as soon as the line

i = array.length
executes it shows the length as an HTMLInput element.

Grabbing the elements using a selector seems like a possible workaround, at least it worked for this particular case:

<  return this.elements ? jQuery.makeArray(this.elements) : this;
>  return this.elements ? jQuery.makeArray(jQuery(":input", this)) : this;

Changed June 15, 2010 02:42AM UTC by dmethvin comment:2

milestone: 1.3.21.4.3

Changed November 11, 2010 02:51AM UTC by dmethvin comment:3

milestone: 1.4.31.5
status: newopen

Changed December 27, 2010 10:36PM UTC by rwaldron comment:4

keywords: serializeserialize,ajaxrewrite

Changed January 02, 2011 10:53PM UTC by snover comment:5

keywords: serialize,ajaxrewriteserialize ajaxrewrite expando
milestone: 1.5
priority: triviallow

Changed April 17, 2011 05:23PM UTC by timmywil comment:6

milestone: → 1.4.4
resolution: → fixed
status: openclosed

This bug no longer seems to be present. http://jsfiddle.net/timmywil/Jrxmy/