Techniques for WCAG 2.0

On this page:

-

# H36: Using alt attributes on images used as submit buttons

## Applicability

Applies to content using image-based submit buttons.

This technique relates to:

- Success Criterion 1.1.1 (Non-text Content)
  - How to Meet 1.1.1 (Non-text Content)
  - Understanding Success Criterion 1.1.1 (Non-text Content)

## 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="http://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

- G94: Providing short text alternative for non-text content that serves the same purpose and presents the same information as the non-text content

## Tests

### Procedure

1. For all input elements that have a type attribute value of "image", check for the presence of an alt attribute.

2. Check that the alt attribute indicates the button's function.

### Expected Results

- #1 and #2 are true

- Top
- Contents
- Intro
- Previous: Technique H35
- Next: Technique H37