next up previous contents
Next: The TEXTAREA Command Up: Laying Out Forms Previous: The INPUT command

The SELECT Command

If you want to provide the user with a long list of items to choose from, it's not very natural to use radio buttons, so HTML provides another command - SELECT. Unlike INPUT, this does have a closing </SELECT> tag. Each option within the list is denoted using the <OPTION> tag. Options must be plain text - no embedded HTML commands are allowed:

<SELECT NAME="food style">
<OPTION> Chinese
<OPTION> South Indian
<OPTION> North Indian
<OPTION> Greek

SELECT must have a NAME attribute, and also allows the following attributes:


This says how many of the options are visible at once, in this case, three.

This allows the user to select more than one item from the list. The default is that only one item can be selected at once.

OPTION tags can also have a SELECTED attribute which says that this option is selected by default. If the SELECT command has a MULTIPLE attribute, then several OPTION tags are allowed to be pre-selected in this way.

Jon Crowcroft
Wed May 10 11:46:29 BST 1995