Forms
Forms
Related to success criteria
- 1.1.1 Non-text Content
- 1.3.1 Info and Relationships
- 1.4.1 Use of Color
- 2.2.1 Timing Adjustable
- 2.4.6 Headings and Labels
- 3.2.4 Consistent Identification
- 3.3.1 Error Identification
- 3.3.2 Labels or Instructions
- 3.3.3 Error Suggestion
- 3.3.4 Error Prevention (Legal, Financial, Data)
- 4.1.2 Name, Role, Value
Accessibility
A form contains a set of form elements, which are UI controls that accepts input.
Form elements are <button>
, <input>
, <select>
, and <textarea>
.
Labels and Instructions
Associate form elements to labels by setting either its:
-
id
attribute to thefor
value of a<label>
element enclosing the label value. -
title
attribute to a label value. -
value
attribute, if it is a button, to a label value.
Use consistent label text for all form elements which perform the same function.
Describe form elements purposes clearly with descriptive label text.
Provide clear instructions (with examples, if applicable) identifying form elements requiring:
- Mandatory data (e.g. required fields)
- Limited set of values (e.g. numeric or text only, upper and/or lower limits)
- Expected data format (e.g. dates, phone numbers, postal codes)
Supplement colour instructions with symbols or text. (e.g. identifying required fields)
Error messages
When providing error messages:
-
Identify the form(s) element affected.
- Explain the error and, if applicable, how to fix it for:
- Missing data (e.g. required fields)
- Outside of allowed values (e.g. numeric or text only, upper and/or lower limits)
- Incorrect format (e.g. dates, phone numbers, postal codes)
Note: For optimal use, it is recommended that error messages appear at the top of the form (when they are server generated).
Session time limits
When a time limit is present, a user must be able to either:
-
Turn off the time limit.
-
Adjust the time limit by extending incrementally up to at least ten times the length of the default setting, ensuring:
- Prompting the user, on each occurence, to adjust the time limit at least 20 seconds before the time expires.
Turning off or adjusting the time limit is not required when the time limit is either:
-
Real-time (e.g. auctions)
-
Essential to the activity and extending it would invalidate the activity (e.g. exams)
-
20 hours or more in length
Legal committments and financial transactions
When legal committments or financial transactions occur as a result of a user submission, a user must be able to either:
-
Reverse the submission (or recover the original data)
- Time limits on the reversal are permitted provided it is stated on the form.
-
Review and correct input before finalizing the submission.
-
Confirm their intent to finalize the submission.
Important: Form elements have additional requirements because they are a type of UI control.
- Date modified: