ptg16476052
Using Other Form Controls 343
12
Output ▼
To create a scrollable list of items, just include the size attribute in the opening select tag, like this:
Input ▼
Figure 12.20 shows the same select element as Figure 12.19, except that the size attribute is set to 3. Setting the size to 3 indicates that the browser should display three options simultaneously.
To see the fourth item , the user would have to use the scrollbar built in to the select list. By default, the value inside the tag specifies both what is displayed in the form and what’s sent back to the server. To send a value other than the display value to the server, use the value attribute. The following code, for example, causes bw499 to be
FIGURE 12.19 You can use select form con- trols to create pull- down menus.
FIGURE 12.20 You also can cre- ate scrollable lists using the select element.