Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Reset buttons Up: Defining fields Previous: Check boxes


Selection fields

Selection 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&uuml;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 up previous contents index
Next: Reset buttons Up: Defining fields Previous: Check boxes

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd