Domino Code Fragment

Code Name*
Using the 'With' statement in JavaScript
Date*
07/08/2000
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.
Description*
The 'with' statement in JavaScript lets you preface an object and all of its properties and methods without a long object address, saving you time while you are coding. For example this function below uses the 'with' statement after the function is declared. The with statement passes the form object which allows the rest of the script to access the form's properties and methods without a full address.
Type*
JavaScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:


This function belows doesn't use the 'with' statement.  Every time you have to access an object  on the form you have to tell the browser where the object is.  Hence the long obect address: document.forms[0].whaturl.selectedIndex.