Web Accessibility at Iowa

Providing expected data format and example

Technique

Specifying data format

You can help users avoid invalid or erroneous inputs by providing information about the input format. For example, if you are asking a user to provide a date, you could specify that the date be entered as mm/dd/yyyy to avoid confusion. This technique is useful for any specialized format, and especially when a control is restricted to a specific input format.

Example:

<label for="date">Please enter the date (mm/dd/yyyy):</label>
<input type="text" id="date" maxlength="10" />

View a form that provides an example of expected data format