Abbey Workshop | ||||||||||
This form shows how to create combo, single select list boxes, and multiple select boxes. The form is submitted to a PHP page that handles the form data passed to it. How that data is handled is also discussed below.
Each of list box type is shown above.
First the combo or drop down box is shown. This form of box includes multiple choices, but only 1 may be selected. In addition, only one option is shown in the list box itself. The for the box looks like this:
<p>Combo Box<br>
<select name="select">
<option value="Option 1" selected>Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
<option value="Option 4">Option 4</option>
</select>
</p>
The select tag identifies the name of the list box, and each option tag identifies both the value that is passed with the form, and the text that appears in the combo box.
<p>List Box - Single Select<br>
<select name="listbox" size="3">
<option value="Option 1" selected>Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
<option value="Option 4">Option 4</option>
<option value="Option 5">Option 5</option>
</select>
</p>
This form is processed by the listbox.php script. You can see the code for this script as follows:
Download source for: listbox.php
Copyright © Abbey Workshop 2006