Modify ↓
Ticket #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: | ||
| Blocking: | Blocked by: |
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
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

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)