Ticket #1163 (closed bug: wontfix)
oForm.elements problem in IE
| Reported by: | mattcopeland | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.1.3 |
| Component: | core | Version: | 1.1.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I was trying to iterate over my form elements using something like: $(oForm.elements).css({color:"#999999"}); This works in FF but not in IE.
I used the size method $(oForm.elements).size() and got the right number of elements in FF but only 1 element in IE.
It seems like FF gets a reference to the collection of elements while IE gets a reference to the form itself.
Change History
comment:2 Changed 6 years ago by brandon
- Status changed from new to closed
- Resolution set to fixed
Fixed in Rev [1892]
comment:3 Changed 6 years ago by brandon
- Status changed from closed to reopened
- Resolution fixed deleted
I have rolled back the fix because passing in a form element is the same as passing in form.elements.
comment:4 Changed 6 years ago by brandon
- Status changed from reopened to closed
- Resolution set to wontfix
I'm marking this as wontfix but I'm providing a work around. Please make sure to call $.makeArray(form.elements) before passing it into $(). Unfortunately IE leaves us no choice since the form element == form.elements.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

The problem is the check for !a.nodeType in jQuery. Unfortunately, form.elements is essentially the form element and has a nodeType.