Be aware that if you are not using some NAME or ID binding to the <FORM> tags, you may get unexpected results if new forms are added and you are accessing elements of this array using numeric index values.
In MSIE version 4, this returns a generic untyped object instead of an AppletArray object. MSIE 5 is more consistent with Netscape .
Following some experiments, it seems that in Netscape (version 4.75) the length of the forms[] array indicates only the number of numerically indexed items in the array. There are additional items added to the array to refer to the same Form objects by name.
// Referring to the first form of a document myFirstForm = document.forms[0]; // Referring to the last form of a document myLastForm = document.forms[document.forms.length-1];
See also: | Document object, Element.all[], Form object, FormArray object |
Prev | Home | Next |
Document.fileSize | Up | Document.frames[] |
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. |