Opened 14 years ago
Closed 12 years ago
#3965 closed bug (fixed)
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)
Change History (7)
Changed 14 years ago by
comment:1 Changed 14 years ago by
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;
comment:2 Changed 13 years ago by
Milestone: | 1.3.2 → 1.4.3 |
---|
comment:3 Changed 12 years ago by
Milestone: | 1.4.3 → 1.5 |
---|---|
Status: | new → open |
comment:4 Changed 12 years ago by
Keywords: | ajaxrewrite added |
---|
comment:5 Changed 12 years ago by
Keywords: | expando added |
---|---|
Milestone: | 1.5 |
Priority: | trivial → low |
comment:6 Changed 12 years ago by
Milestone: | → 1.4.4 |
---|---|
Resolution: | → fixed |
Status: | open → closed |
This bug no longer seems to be present. http://jsfiddle.net/timmywil/Jrxmy/
demo of bug