Changes

Building Forms with JavaScript

17 bytes added, 20:14, 15 May 2007
Accessing Objects in a Form
As we mentioned in the previous section the Form object is really just a container which contains other objects (such as text fields and buttons). Later in the chapter we will learn how to create those objects inside the Form object. First, however, it is useful to explore how to access the oibjects in a Form.
One way to access the elements in a Form is to use the Form object's ''elements'' property. This is an array containing all the objects in a Form (see [[JavaScript Arrays]] for details). We can, therefore, access any element in the array by using the index (note that the objects in the array are in the order in whcih they are specified in the Form. Suppose we have a text object which is the first object inside a Form called myForm. : <pre> </pre>  We can access this object as follows:
<pre>