SELECT - selection list in a form
Description :
The SELECT tag
defines a selection list on an HTML form. A selection list
displays a list of options from which the user can select an item.
If the MULTIPLE attribute is supplied, users can select multiple
options from the list at a time. If the MULTIPLE attribute is not
supplied users can select only one option in the list at a time.
The SIZE attribute specifies how many options in the list are
displayed at one time. For multiple-selection lists, if you do not
specify the SIZE attribute, the browser displays some, maybe all,
of the options. For single-selection lists, the browser displays
the list as a drop-down menu that initially shows only one option.
The user can click the list to display the rest of the options. If
you specify the SIZE attribute, the list is displayed as a
scrolling list that shows the specified number of options,
regardless of whether the list allows single or multiple
selection.
When the form containing the selection list is submitted to the
server, a name/value pair is sent for each selected option in the
list.
The SELECT tag should be used between <FORM> and
</FORM> tags. Similarly, the <OPTION> tags would be
used inside the <SELECT> tags.
Syntax
<SELECT NAME="selectName"
MULTIPLE ONBLUR="JScode" ONCHANGE="JScode"
ONCLICK="JScode" ONFOCUS="JScode" SIZE="listLength">....</SELECT>
Attributes
NAME = specifies the name of the select element.
This value is the name portion of the name/value pair sent to the
invoked CGI program when the form is submitted. The name is not
displayed on the form.
MULTIPLE = specifies that multiple items can be
selected. If this attribute is omitted, only one item can be
selected from the list. If multiple selection is enabled, the user
usually needs to hold down the Shift key to select additional
items.
ONBLUR = specifies JavaScript code to execute
when the select element loses focus.
ONCHANGE = specifies JavaScript code to execute
when the select element loses focus and its value has been
modified.
ONCLICK = specifies JavaScript code to execute
when a user clicks an item in the list.
ONFOCUS = specifies JavaScript code to execute
when the element gets focus.
SIZE = specifies the number of options visible
when the form is displayed. If the list contains more options than
specified by size, the list is displayed with scrollbars.
|