Techniques for WCAG 2.0

On this page:

-

# G89: Providing expected data format and example

## Applicability

Pages that collect information from users, and restrict the format the user can use.

This technique relates to:

- Success Criterion 3.3.2 (Labels or Instructions)
  - How to Meet 3.3.2 (Labels or Instructions)
  - Understanding Success Criterion 3.3.2 (Labels or Instructions)
- Success Criterion 3.3.5 (Help)
  - How to Meet 3.3.5 (Help)
  - Understanding Success Criterion 3.3.5 (Help)

## Description

The objective of this technique is to help the user avoid input errors by informing them about restrictions on the format of data that they must enter. This can be done by describing characteristics of the format or providing a sample of the format the data should have.

Note: For data formats with common variations, such as dates and times, it may be useful to provide a preference option so users can use the format that is most comfortable to them.

## Examples

### Example 1

The following HTML form control for a date indicates in the label that the date must be in day-month-year format, not month-day-year as many users in the United States may assume.

Example Code:

    <label for="date">Date (dd-mm-yyyy)</label>
    <input type="text" name="date" id="date" />

## Related Techniques

- G184: Providing text instructions at the beginning of a form or set of fields that describes the necessary input

## Tests

### Procedure

1. Identify form controls that will only accept user input data in a given format.

2. Determine if each of the form controls identified in 1 provides information about the expected format.

### Expected Results

- #2 is true.

- Top
- Contents
- Intro
- Previous: Technique G88
- Next: Technique G90