Element

textarea

Error Type

Known

Guidelines

  • BITV 1.0 (Level 2)
    Guideline GroupLevel 1
    Guideline Subgroup12.4 Associate labels explicitly with their controls.
  • WCAG 1.0 (Level AA)
    Guideline GroupPriority 2
    Guideline Subgroup12.4 Associate labels explicitly with their controls.
  • WCAG 1.0 (Level AAA)
    Guideline GroupPriority 2
    Guideline Subgroup12.4 Associate labels explicitly with their controls.
  • WCAG 2.0 (Level A)
    Guideline Group1.3 Ensure that information and structure can be separated from presentation
    Guideline SubgroupSuccess Criteria 1.3.1 Info and Relationships (A)
  • WCAG 2.0 (Level AA)
    Guideline Group1.3 Adaptable: Create content that can be presented in different ways (for example simpler layout) without losing information or structure.
    Guideline SubgroupSuccess Criteria 1.3.1 Info and Relationships (A)
  • WCAG 2.0 (Level AAA)
    Guideline Group1.3 Adaptable: Create content that can be presented in different ways without losing information or structure.
    Guideline SubgroupSuccess Criteria 1.3.1 Info and Relationships (A)

Requirement

All textarea elements have an explicitly associated label.

Error

textarea element missing an associated label.

Short Description

All textarea elements must have an explicitly associated label.

How To Repair

Add a label element immediately before or after the textarea element. Set the for attribute value of the label element to the same value as the id attribute value of the textarea element. Add label text to the label element. Or, set the title attribute value to the textarea element to the label text. Or, add a label element that surrounds the textarea element and add label text.

Steps To Check

Procedure

1. Check all textarea elements.\r\n2. Each textarea element must have an explicitly associated label using one or more of the following methods.\r\n3. The textarea element has an id attribute value that matches the for attribute value of a label element.\r\n4. and/or\r\n5. The textarea element has a title attribute.\r\n6. and/or\r\n7. The textarea element is contained by a label element.

Expected Result

1. All textarea elements have an explicitly associated label.

Failed Result

1. Create a label element for the textarea element and associate these elements using the ID and for attributes.\r\n2. and/or\r\n3. Add a title attribute to the textarea element.\r\n4. and/or\r\n5. Add a label element that contains the textarea element.

Examples

Pass Examples

textarea element has an associated label using label element.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>ATRC Testfile - Check #95.2 - Positive</title>
</head>
<body>

<form action="http://www.test.com/testing" method="post">
<label for="text1">Comments:</label>
<textarea name="nametext" id="text1" rows="5" cols="40">
</form>

</body>
</html>

Fail Examples

textarea element does not have associated label.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
<title>ATRC Testfile - Check #95.1 - Positive</title>
</head>
<body>

<form action="http://www.test.com/testing" method="post">
<label>Comments:</label>
<textarea name="nametext" id="text1" rows="5" cols="40">
</form>

</body>
</html>
Web site engine's code is copyright © 2023
Inclusive Design Institute