Forms: HTML
Create Menu Boxes
| Create a Form | Remember that you create a form field with
the <FORM></FORM> tag pair.
Within the <FORM> tags will go the entire form, i.e. both the questions you ask and the form elements, i., e., the box and button spaces where the user will supply responses. |
|
| The Menu Box | A menu box allows a user to tab through a dropdown list to make a selection from a number of choices. | |
| Example | ||
| To create a menu box, start with the <SELECT></SELECT>
tag pair.
Within the opening <SELECT> tag you will add several attributes. |
||
| NAME refers to the type of
information being gathered when the user selects an option from the
menu box.
SIZE determines the number of menu items initially visible on the screen, MULTIPLE allows a user to choose more than one item in the menu. |
||
| Thus the initial basic code for a menu box will be: | ||
| <SELECT NAME="[name]" SIZE="[n]" MULTIPLE="[n]"></SELECT> | ||
| Next, use the <OPTION>
tag with the VALUE attribute to specify each item in the contents of
your menu box.
OPTION VALUE refers to the information gathered when the user makes a particular choice from a menu. For each option on the dropdown menu use the following HTML code: |
||
| <OPTION VALUE="[value[">Option Name | ||
| You must repeat the <OPTION
VALUE="[value]"> tag for every choice in the menu.
All of your <OPTION VALUE="[value]">tags must nest within your <SELECT></SELECT> tag pair. If you wish, you can specify a particular menu choice that will be pre-selected for the user. Use the SELECTED attribute for an option that you want to pre-select for the user. |
||
| The HTML code for the sample menu box above is: | ||
|
What is your area code? <SELECT NAME="areacode" SIZE="1"> <OPTION SELECTED VALUE="703"> 703
|
||
| Remember that this code goes within the <FORM></FORM> tag pair | ||
Forms: HTML
Overview
Create a Form
Create Text and Password Boxes
Create Radio Buttons
Create Checkboxes
Create Menu Boxes
Create Text Blocks
Create the Reset and Submit Buttons
Web Design Center
Last Revised:
February 9, 2004
© Agatha Taormina