
<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.
82523c14.indd 581 2/18/09 1:29:50 ...