Creating a Selection List

The next part of the contest form is dedicated to collecting information on the flavor preference of individual entries. The first field you'll create in this section will record the base flavor for the new ice cream. There are four flavors that will be listed:

  • Vanilla
  • Chocolate
  • Strawberry
  • Banana

Because the flavors constitute a predefined list of values , you will display this information with a selection list. A selection list is a list box from which the user selects a particular value or set of values, usually by clicking the item with the mouse. Generally it's a good idea to use selection lists rather than input boxes when you have a fixed set of possible responses.

To create a selection list, use the following set of HTML tags:

<SELECTION NAME=Text>

<Option>Option 1

<Option>Option 2

</SELECT>

where Text is the name you've assigned to the selection field, and Option 1, Option 2, and so forth are the possible values displayed in the selection list. Notice that the values for each option are entered to the right of the <OPTION> tag rather than inside the tag.

To allow the user to select multiple items in the selection list, use the following tag:

<SELECT MULTIPLE>

To display several items in the selection list, or to change the selection list style from a drop-down list box to a fully displayed list box, use the following tag:

<SELECT SIZE=Value>

where Value is the number of items displayed in the list box.