[an error occurred while processing this directive]

Option List

Option lists allow the user to select from a list. Option lists can be drop down list boxes, like this:


<SELECT NAME=platforms>
<OPTION>Windows
<OPTION>Macintosh
<OPTION>UNIX
</SELECT>

Simple listboxes, like this:


<SELECT NAME=platforms SIZE=3>
<OPTION>Windows
<OPTION>Macintosh
<OPTION>UNIX
</SELECT>

Or scrolling listboxes, like this:


<SELECT NAME=platforms SIZE=3>
<OPTION>Windows
<OPTION>Macintosh
<OPTION SELECTED>UNIX
<OPTION>Amiga
<OPTION>Next
<OPTION>AppleII
</SELECT>

Whether or not an option list is displayed as a drop-down listbox, a simple listbox, or a scrolling listbox is determined by the SIZE keyword in the SELECT tag. SIZE refers to the number of rows visible to the user at once. If the SIZE is one (the default), a drop-down listbox will appear. If the SIZE is greater than one, and the number of options is less than or equal to the SIZE, a simple list box is displayed. If the SIZE is greater than one, but the number of options available to the user is greater than the SIZE, a scroll bar will appear to the right of the listbox to allow the user to scroll through the options.

Using the SELECTED keyword after OPTION (as for the UNIX option in the above example) causes that option to be selected by default. By default, only one of a list of options is selectable, however this can be overridden by including the MULTI keyword in the SELECT tag.

Quirk: Lynx does not properly insert space after a heading when it is followed by an option list form! You must insert paragraph markers around the select option to prevent your form from appearing distorted when viewed with Lynx.

Next lesson: advanced option lists

Index of tutorial topics



WebCom Home
Contact us by email:info@webcom.com
phone: 1-888-8WEBCOM (1-888-893-2266)
Copyright © 1994 - 2001 Web Communications.   A Member of the Verio Group.