Skip to main content

Bug Tracker

Side navigation

#1446 closed bug (invalid)

Opened July 31, 2007 10:02AM UTC

Closed September 15, 2007 01:37PM UTC

init method doesn't check correctly form.elements property

Reported by: Andrea Giammarchi Owned by:
Priority: major Milestone: 1.2.1
Component: core Version: 1.2
Keywords: Cc:
Blocked by: Blocking:
Description

form.elements has different behaviour.

While FireFox and Opera pass this check:

!form.elements.nodeType

where nodeType is undefined, Internet Explorer 6 (I don't know about 7) returns nodeType === 1 so I've temporary fixed return value inside init method using this check:

return this.setArray(
	a.constructor == Array && a ||
	(a.jquery || a.length && a != window && (!a.nodeType || a.length) && a[0] != undefined && a[0].nodeType) && jQuery.makeArray( a ) ||
	[ a ]
);
Attachments (0)
Change History (2)

Changed July 31, 2007 01:16PM UTC by Andrea Giamm comment:1

fix proposal breaks other "queries". I suppose this is an IE <= 6 bug and not a jQuery problem.

In IE form.elements === form and form.elements.elements.elements is === form again.

Every property/method is the same because it's a form referer (wow ... )

Use $.each(form.elements, callback) to solve this strange behaviour (so I suppose this ticket should be closed)

Changed September 15, 2007 01:37PM UTC by john comment:2

milestone: 1.1.41.2.1
resolution: → invalid
status: newclosed
version: 1.1.31.2

Closed at the request of poster.