HTML and CSS Reference
In-Depth Information
Tables are often used to organize forms on Web pages. Modify your page as indicated
here. Save the file with a new name, contact2.html, test in a browser, and compare your
result with Figure 9.17. The solution can be found in the student files at
Now you are familiar with using forms on Web pages, with different controls that can
be placed on forms, and with using a table to format a form. Additional detailed infor-
mation on these form elements and their attributes may be found in Appendix A,
XHTML Reference.
1. You are designing a Web site for a client who sells items in a retail store. They want to
create a customer list for e-mail marketing purposes. Your client sells to consumers and
needs a form that accepts a customer's name and e-mail address. Would you recom-
mend using two input boxes (one for the name and one for the e-mail) or three input
boxes (one each for the first name, last name, and e-mail address)? Explain your answer.
2. You are designing a survey form for a client. One of the questions has 10 possible
responses. Only one response can be selected per question. What type of form control
would you use to configure this question on the Web page?
3. True or False? In a radio button group, the value attribute is used by the browser to
process the separate radio buttons as a group.
9.3 Form Enhancements
There are additional XHTML tags that can enhance your forms by associating text
labels with form controls and by visually grouping form controls together.
The Label Element
The <label> element is a container tag that is used to associate a text description with
a form control. It is sometimes difficult for a person using a screen reader to match up
the text descriptions on forms with their corresponding form controls. The purpose of
the label element is to explicitly associate a form control with the text label that
describes it. The label element also benefits individuals without fine motor control.
Clicking anywhere on either a form control or its associated text label will set the cur-
sor focus to the form control. In addition, the label element can serve as a fragment
identifier or bookmark and allow the form control to be directly linked to other parts
of the Web page (or other Web pages, if needed).
Focus on Accessibility
Search WWH ::

Custom Search