Webmaster

HTML : Fill-In Forms
Contents ]
Jérôme Versavel

Selection Lists

The last type of controls available for forms is used to display a list of options from which users can make a selection.

Example:

<SELECT NAME="month">
<OPTION VALUE="01">January
<OPTION VALUE="02">February
<OPTION VALUE="03">March
<OPTION VALUE="04"> April
...
</SELECT>

Which produces the following list box:



Each item in the list is defined by a separate <OPTION> tag. The value returned by the selected button is supplied by its VALUE attribute. If is has no value, the text of the option is returned.

The SIZE attribute of the <SELECT> tag sets the number of options which are always visible in the list. If the value specified is lower than the number of proposed items, a scrollbar is automatically displayed at the right of the list box. And if the SIZE attribute is not specified, the control is rendered as a drop-down list.



  1   2   3   4   5   6