Element

input

Error Type

Known

Guidelines

  • WCAG 2.0 (Level A)
    Guideline Group1.1 Text Altrernatives: Provide text alternatives for any non-text content
    Guideline SubgroupSuccess Criteria 1.1.1 Non-text Content (A)
  • WCAG 2.0 (Level AA)
    Guideline Group1.1 Text Alternatives: Provide text alternatives for any non-text content
    Guideline SubgroupSuccess Criteria 1.1.1 Non-text Content (A)
  • WCAG 2.0 (Level AAA)
    Guideline Group1.1 Text Alternatives: Provide text alternatives for all non-text content
    Guideline SubgroupSuccess Criteria 1.1.1 Non-text Content (A)

Requirement

All input elements, except those with with a type attribute value of "image", do not have an alt attribute.

Error

input element has alt attribute.

Short Description

The input element is used to create many kinds of form controls. Although the HTML DTD permits the alt attribute on all of these, it should be used only on image submit buttons. User agent support for this attribute on other types of form controls is not well defined, and other mechanisms are used to label these controls.

How To Repair

Remove the alt attribute from all input elements except those with a type attribute value of "image".

Steps To Check

Procedure

1. Check each input element in the document.
2. Check the type attribute value of the input element.
3. Check for the presence of an alt attribute.

Expected Result

1. All input elements, except those with with a type attribute value of "image", do not have an alt attribute.

Failed Result

1. Remove the alt attribute from all input elements except those with a type attribute value of "image".

Examples

Pass Examples

input element with type of "submit" does not have an alt attribute
<?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 #238.2 - Negative</title>
</head>
<body>

<form action="http://mysite.com">
<p><input type="submit" value="submit"/></p>
</form>

</body>
</html>

Fail Examples

input element with type of "submit" has an alt attribute.
<?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 #238.1 - Positive</title>
</head>
<body>

<form action="http://mysite.com">
<p><input type="submit" value="submit" alt="submit the form"/></p>
</form>

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