Skip to Main Content
Adobe® Dreamweaver® CS4 Bible
book

Adobe® Dreamweaver® CS4 Bible

by Joseph Lowery
March 2009
Beginner to intermediate content levelBeginner to intermediate
1321 pages
46h 24m
English
Wiley
Content preview from Adobe® Dreamweaver® CS4 Bible
581
Interactive Forms
14
<label> tag, you can explicitly associate the text with a particular control. You have two options for
achieving this association:
Wrap With Label Tag
—This option encloses the form element within the <label>
</label> pair. Here’s an example of its construct:
<label>First Name
<input type=”text” name=”mytextfield”>
</label>
Attach Label Tag Using ‘for’ Attribute
—This option adds an attribute to the <label> tag
that matches the
id attribute of the form element. Choose this option, for example, when
you use a table to align form elements, and the label and control appear in separate table
cells. Here’s an example that illustrates the use of the
for attribute:
<label for=”mytextfield”>First Name</label>
<input type=”text” name=”textfield2” id=”mytextfield”>
FIGURE 14-13
The Input Tag Accessibility Attributes dialog box is displayed only when you have enabled
the Form Objects option in the Accessibility category of Preferences.
You can also insert a <label></label> pair by clicking the Label button in the
Forms category of the Insert panel. This button is best used in Code view.
Although you may visually achieve the same effect by simply typing the text in the Document win-
dow, a nonvisual browser cannot associate plain text with any particular object. This effect is also
what happens if you choose the No Label Tag option.
TIP
TIP
82523c14.indd 581 2/18/09 1:29:50 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Adobe® Dreamweaver® CS5 Bible

Adobe® Dreamweaver® CS5 Bible

Joseph W. Lowery
Dreamweaver® CS3 Bible

Dreamweaver® CS3 Bible

Joseph W. Lowery

Publisher Resources

ISBN: 9780470382523Purchase book