Jeff's Javascript Reference

Form Entities

Referring to the different types of form entities is a pain. Thus, the following table may help:

Note: All entities may assume prefixes of document.forms[index] and i refers to the index [0 .. n] of that named entity.

Entities, Properties, Values, and Results of Input Types


Radio Buttons

Example
Y / N
Property
input_name[i].checked == true | false
Value(s)
input_name[i].value
Result
input_name=value

Check Boxes

Example
A
B
Property
input_name == true | false
Value(s)
on or null
Result

If the checkbox is not turned on, no entry appears in the form submission ($QUERY_STRING or <STDIN>)

Despite the VALUE attribute, this is what you get:

input_name=on | ''


Text

Example
Property
input_name == true | false?
Value
input_name.value
Result
input_name=value

Textarea

Example
Property
input_name == true | false?
Value
input_name.value
Result
input_name=value

Select (single-entry mode)

Example
Property
input_name[i] == true | false?
Value
input_name.value, primarily from the VALUE attribute of the <OPTION> tag, or secondarily from the text immediately following the tag but before the next <OPTION> or /SELECT.
Result
input_name=value