CARVIEW |
On this page:
H36: Using alt
attributes on images used as submit buttons
Important Information about Techniques
See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.0 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.0.
Applicability
Applies to content using image-based submit buttons.
This technique relates to:
Description
For input elements of type 'image', the alt
attribute of the
input
element is used to provide a functional label. This label indicates
the button's function, but does not attempt to describe the image. The label is
especially important if there are multiple submit buttons on the page that each lead to
different results.
The input
element is used to create many kinds of form controls. Although
the HTML and XHTML DTDs 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.
Examples
Example 1
An input
element with an alt
attribute
Example Code:
<form action="https://example.com/prog/text-read" method="post">
<input type="image" name="submit" src="button.gif" alt="Submit" />
</form>
Resources
Resources are for information purposes only, no endorsement implied.
Related Techniques
Tests
Procedure
For all
input
elements that have a type attribute value of "image", check for the presence of analt
attribute.Check that the
alt
attribute indicates the button's function.
Expected Results
#1 and #2 are true
If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.
This Web page is part of Techniques and Failures for Web Content Accessibility Guidelines 2.0 (see the latest version of this document). The entire document is also available as a single HTML file. See the The WCAG 2.0 Documents for an explanation of how this document fits in with other Web Content Accessibility Guidelines (WCAG) 2.0 documents. To send public comments, please follow the Instructions for Commenting on WCAG 2.0 Documents.
Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules apply.