HTML and CSS Reference
In-Depth Information
Common select list attributes are listed in Table 9.7.
Table 9.7 Common select list attributes
Common
Attributes
Values
Usage
Select List <select> Ta g
name
Alphanumeric, no spaces,
begins with a letter
Names the form element so that it can be easily accessed by
client-side scripting languages (such as JavaScript) or by server-
side processing. The name should be unique.
Alphanumeric, no spaces,
begins with a letter
Provides a unique identifier for the form element.
id
Numeric
Configures the number of choices the browser will display. If set to
1 , element functions as a drop-down list (see Figure 9.10). Scroll
bars are automatically added by the browser if the number of
options exceeds the space allowed.
size
Configures a select list to accept more than one choice. By
default, only one choice can be made from a select list.
multiple
multiple
Select List <option> Ta g
value
Text or numeric
characters
Assigns a value to the option. This value can be accessed by
client-side and by server-side processing.
Configures an option to be initially selected when displayed by a
browser.
selected
selected
Submit Button. This form control is configured by the <input /> tag and is used to
submit the form. It triggers the action method on the <form> tag and causes the
browser to send the form data (the name and value pairs for each form control) to the
Web server. The Web server will invoke the server-side processing program or script
listed on the form's action property. A sample submit button is shown in Figure 9.12.
Figure 9.12
Clicking the submit
button invokes the
server-side
processing
configured in the
action property of
the <form> tag
The XHTML code follows:
<input type="submit" />
Common submit button attributes are listed in Table 9.8.
 
Search WWH ::




Custom Search