Form.elements.length is not really a property of the Form object but it is convenient to discuss it here since it is related to the Form.length property.
The structural model of the form and its length property is somewhat confusing because there is an elements[] collection which is really what is being measured. Somehow, the elements all being members of the Form object, means that the Form object's length value is really the length value of the elements[] collection.
The elements collection is really a reference to the Form object and this means the elements collection is polluted with a lot of associatively named member items that are not actually form elements at all.
It is possible that future browser versions will correct this and that a proper FormElementArray class is created. For legacy reasons, the Form.length parameter may need to persist.
See also: | Collection.length, Form.length, FormElement object, length |
Prev | Home | Next |
Form.action | Up | Form.elements[] |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |