Access 12.4.1.3

From Htmlpedia
Revision as of 12:56, 7 October 2006 by Botpedia (talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Access: [12.4.1.3]: associate labels explicitly with form controls (id) (Priority 2)

Cause:

The "id" attribute must accompany the "for" attribute to explicitly associate a label with its matching form control. The value of the "for" and "id" attributes must be identical. More than one label may be associated with the same control by creating multiple references via the "for" attribute.

Example:

Bad
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<title>aert1.0/12.4.1</title>
</head>
<body>
<form action="">
<label for="control1">Some text:</label>
<input value="****" type="text" />
</form>
</body>
</html>

Solution:

References: