|
|||||||||
|
Selection fieldsSelection fields provide a set of options in a style that takes up less space than a set of radio buttons or check boxes, but with the same functionality, for example:
<SELECT NAME="s-field" > <OPTION SELECTED>option 1<OPTION>option 2 <OPTION>option 3<OPTION>option 4 </SELECT> A selection field is specified by a SELECT element (not by an attribute of the INPUT element) containing a number of options, each specified with the OPTION element. Only OPTION elements are allowed as contents of the SELECT element. The SELECT element has a single optional attribute, MULTIPLE, which indicates that the user can choose several options at the same time. When this is specified the selection is functionally equivalent to a group of check boxes, otherwise it is equivalent to a group of radio buttons. Each OPTION element represents a single choice. If the SELECTED attribute is specified for the option, then it is initially selected. The text following the <OPTION> tag is used as the label for the option. The data to be sent to the server when the option is selected can be explicitly specified with the VALUE attribute, otherwise the text is used. For example:
<OPTION VALUE="green">grün displays the German word grün as the on-screen label, but sends the English word green back to the server as data. The </OPTION> end tag can be omitted, since the option is implicitly terminated by the following <OPTION> or </SELECT> tag.
Next: Reset buttons Up: Defining fields Previous: Check boxes
Spinning the Web by Andrew Ford |
||||||
Copyright © 1996-2002 Ford & Mason Ltd |