<select> Syntax
Syntax Diagram for <select>
Opening Tag |
Content |
Closing Tag |
Open |
Parameter |
= |
Value |
Close |
<select |
name |
= |
"name" |
> |
option list |
</select> |
size |
= |
lines |
multiple |
<select> Description
The <select> input element of a <form> is a
one-of-many (if multiple was not specified) or n-of-many (if
multiple was specified) selection mechanism.
- name
- Specifies the name of the field, so the handling script can associate the
field name and its value.
- size
- Specifies the height, expressed in lines of text, of the selection list.
This is not a logical size, but just an apparent
size--entries will automatically scroll on and off the top and bottom of
the list as the scroll bar is moved. Default is 1. If size=1,
the list is presented as a pop-up menu; if size>1, the list is
presented as a vertical list with a scroll bar.
- multiple
- Specifies whether or not the scrolling list allows multiple items to be
selected simultaneously.
- value
- Allows an alternate value to be passed to the processing script (see the
"President" example below). If a value is not specified, the value
passed to the processing script is option.
- selected
- Specifies that the given option is to be preselected, to give the
user a default value for the selection.
See also the <form> tag, as well as <input> and <textarea>.
<select> Examples
This markup:
. . .causes these results:
Last Modified: