Closed Bug 113197 Opened 24 years ago Closed 24 years ago

document.forms[0].length isn't counting inputs of type image

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: doug+bugzilla, Assigned: jst)

References

()

Details

I've created a very small page that has two form elements on it. One is of type image and the other is of type button. The button has an onclick event to run javascript alert(document.forms[0].length). I would expect to get the number 2 out. Instead I get only 1. It doesn't matter how many inputs I put of type image. They all get ignored/not counted. I've also tested this on Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:0.9.6) Gecko/20011120.
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → amar
Confirming with Mozilla trunk binary 20011126xx WinNT. Browser, not engine. Reassigning to DOM Level 0 -
Status: UNCONFIRMED → NEW
Ever confirmed: true
<input type="image"> elements are not included in form.elements in any versions of IE, nor in any versions of Netscape, therefore they are not included in form.elements in mozilla either for compatibility reasons. INVALID.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
IE 5.0 on Mac OS8.6, IE 5.5 Mac OS X 10.1.1, and IE 5.5 on Mac OS 9.2 (in classic env.) counts <input type="image"> elements. This is one of those times when I think the rest of the hurd is crazy. Does the html standard say that <input type="image"> is not legal form element? Is there any good reason (other than compatibility with possibly broken browsers) not to count these elements? Taking a look at http://www.w3.org/TR/html401/interact/forms.html#h-17.4 http://www.w3.org/TR/html401/interact/forms.html#input-control-types I don't see anything about <input type="image"> as being second-class elements.
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Mac IE is non-compliant with the defacto standard DOM0, IE x.x on windows, and all versions of Netscape that supports <input type="image"> do *not* include them in form.elements. We will not fix this, fixing this would cause a significant number of sites to break, IE on the mac will not work on those pages either, and I wouldn't expect the sites to "fix" their pages just because Mac IE is broken. WONTFIX.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → WONTFIX
I wish someone would explain to me why this has become accepted when it does not conform to any actual DOM specs.
It's accepted because it conforms to the defacto DOM0 (i.e. current behavior of IE 3+ and NS3+), it's all about compatibility with the majority of the browsers used out there. DOM0 might not be written down anywhere, but it's nevertheless a *very* important *standard*, ever wonderd where the definition of the |window| object in mozilla comes from?
You need to log in before you can comment on or make changes to this bug.