HTML and CSS Reference
In-Depth Information
The XHTML code follows:
Select your favorite browser:<br />
<input type="radio" name="favbrowser" id="favIE"
value="IE" /> Internet Explorer<br />
<input type="radio" name="favbrowser" id="favFirefox"
value="Firefox" /> Firefox<br />
<input type="radio" name="favbrowser" id="favOpera"
value="Opera" /> Opera<br />
Notice that the name attributes all have the same value— favbrowser . This is what creates
the group. Each radio button in the same group can be uniquely identified by its value
attribute . Each radio button in the same group is configured with a different value.
Common radio button attributes are listed in Table 9.5.
Table 9.5 Common radio button attributes
Attribute
Values
Usage
Configures the radio button.
type
radio
name
Alphanumeric, no spaces,
begins with a letter
Required. All radio buttons in a group must have the same name. This
attribute also names the form element so that it can be easily accessed
by client-side scripting languages or by server-side processing.
Alphanumeric, no spaces,
begins with a letter
Provides a unique identifier for the form element.
id.
Configures the radio button to be selected by default when displayed
by the browser.
checked
checked
Text or numeric characters
Assigns a value to the radio button that is triggered when the radio
button is selected. This should be a unique value for each radio but-
ton in a group. This value can be accessed by client-side and by
server-side processing.
value
Scrolling Text Box. The <textarea> tag configures a scrolling text box. A scrolling
text box is used for accepting free-form comments, questions, or descriptions. A sample
scrolling text box is shown in Figure 9.9.
Figure 9.9
Scrolling text boxes
accept free-form
comments from
Web page visitors
The XHTML code follows:
Comments:<br />
<textarea name="ordercomments" id="ordercomments" cols="40"
rows="2">Enter your comments here</textarea>
Notice that the <textarea> tag is a container tag. The text that you place between
the opening <textarea> and closing </textarea> will be initially displayed in the
scrolling text box.
 
Search WWH ::




Custom Search