Bug Tracker

Opened 13 years ago

Closed 13 years ago

#1446 closed bug (invalid)

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 ]
);

Change History (2)

comment:1 Changed 13 years ago by Andrea Giamm

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)

comment:2 Changed 13 years ago by john

Milestone: 1.1.41.2.1
Resolution: invalid
Status: newclosed
Version: 1.1.31.2

Closed at the request of poster.

Note: See TracTickets for help on using tickets.