HTML and CSS Reference
In-Depth Information
Add an input box for the
favDish
field to the survey form now and augment it with a
data list of suggested Red Ball Pizza dishes.
To create a data list:
◗
1.
Return to the
survey.htm
file in your text editor. Directly below the input box for
the
ordersPerMonth
field, insert the following code (see Figure 6-61):
<label for=”favDish”>What's your favorite Red Ball dish?</label>
<input name=”favDish” id=”favDish” list=”dishType” />
<datalist id=”dishType”>
<option value=”Antipasto Pizza” />
<option value=”Big Kahuna Pizza” />
<option value=”BBQ Chicken Pizza” />
<option value=”Mediterranean Herb Pizza” />
<option value=”Pasta Rolls” />
<option value=”Pesto Artichoke Pizza” />
<option value=”Sal's Stuffed Pizza” />
<option value=”Wing'd Pizza” />
</datalist>
figure 6-61
adding a data list
access
es the
dishType data list
data list of text
options
◗
2.
Save your changes to the file and then reopen
survey.htm
in the Firefox or Opera
Web browser.
◗
3.
Click the input box for the
favDish
field and type the letter
p
. In Opera, the
browser displays a list of two menu items that begin with the letter P (see
Figure 6-62). In Firefox, the browser displays any option that contains the letter P,
not just options that begin with the letter P.