Fire-House 58

Objects

form

o-2


JavaScript:
gascripts.com form objects are specified are specified within the <form> tags of the HTML document.. Each object can be called from a script by specifying its name in the object hierarchy.

 

Hard Reload
To See Menu

Text Object Password Object
 

Textarea Object

 

Select Object

 
Checkbox Object
document.form.checkbox1
document.form.checkbox2
document.form.checkbox3
 
Radio Button Object
document.form.radio[1]
document.form.radio[2]
document.form.radio[3]
Hidden Object  <input type="hidden"  

Button Object

document.form.hidden document.form.button
 

Reset Object

 

Submit Object

document.form.reset document.form.submit
 

File Upload Object


document.form.file

N
O
T
E

The HTML <form> tags must be in place in order for Navigator to read button elements. MSIE accepts soft references to form elements, Navigator won't. In the example below, MSIE recognizes the call to it from form jo, and treats the function as though it were preceded by a with statement. The Navigator syntax works with both browsers.

MSIE soft reference allowed

Navigator hard reference required

<script language="JavaScript">
<!--
<script language="JavaScript">
<!--
function show(form) {
jo.jojo.value = "So consider using hard references" }

//  soft reference by form name only
// -->
</script>

function show(form) {
document.jo.jojo.value = "So consider using hard references" }
//  hard reference includes full hierarchy
// -->
</script>

<form name="jo"><textarea rows="3" name="jojo" cols="20" onFocus="show(this.form)"> Beware!Browsers read thing's differently.</textarea>

<form name="jo"><textarea rows="3" name="jojo" cols="20" onFocus="show(this.form)"> Beware!Browsers read thing's differently.</textarea>


[back]   [home]   [next]