Next / Previous / Contents / TCC Help System / NM Tech homepage

9. Pull-down menus

To provide a pull-down menu that gives the user one of several choices:

<select name="fieldName">
  <option selected>first option
  <option>second option
  …
</select>

The entire pull-down menu must be bracketed by <select></select> tags, and each option's text must be preceded by an <option> tag. One of the options (it need not be the first one) may be preceded by an <option selected> tag; that option will be the default.

Only plain text can appear after each option tag; do not attempt to imbed HTML tags within an option.

When the form data is sent to the downstream CGI script, the name part of the (name,value) pair for a pull-down menu comes from the name attribute of the <select> tag, and the value part is the text of the <option> choice selected by the user.