Accessibility Design Guidelines:
Purchase Forms
Forms can be one of the most challenging aspects of navigating a website and considered a common barrier for people with disabilities. Forms are an essential aspect of accomplishing a user's end goal on a webpage and for this reason designers must make forms accessible for all users. When designing forms, following the WCAG accessibility Success Criteria is crucial, regardless of what the purpose of the form is (e.g., log in/sign up, search, contact).
Users that rely on only a keyboard must be able to tab through fields in a sequential order to enter information and submit data. People with cognitive or visual impairments will benefit when the form provides meaning instructions in regards to the form's purpose before the form begins. Read more about how this relates to Success Criterion 3.3.2
In addition, form fields must be clearly marked with meaningful and relevant labels in order to associate the form field with the label. Read more about how this relates to Success Criterion 1.3.1 and Success Criterion 2.4.6
<label for="firstname">First Name</label>
<input type="text" name="firstname" id="firstname" />
Figure A: Label is associated with a specific form control through the use of the <for> attribute.
Source: Photo by Jon Tyson on Unsplash
"The objective of this technique is to use the label element to explicitly associate a form control with a label. A label is attached to a specific form control through the use of the for attribute. The value of the for attribute must be the same as the value of the id attribute of the form control." See Figure A
By following best practices, we can make forms easier to understand, complete, and submit for people with disabilities.
Click on the icons below to reveal the corresponding WCAG Success Criteria
In this example, a Product Purchase and Checkout Process is used to demonstrate the implementation of various WCAG Success Criteria seen in common elements that make up a <form>, such as <input>, <label>, <textarea>, and <button>.
"These techniques provide important cues and instructions that will benefit people with disabilities. Too much information or instruction can be just as harmful as too little. The goal is to make certain that enough information is provided for the user to accomplish the task without undue confusion or navigation."
One of the first steps in purchasing a product online involves multiple features that if not accessible, prevent some users from reaching their goal. Images, headings, descriptive text, legible buttons and tabbed keyboard navigation, must be considered when designing cards that are AODA compliant.
NOTE: To make a website even more accessible, designers can refer to the Success Criterions related to appearance (UI) to help users with vision and cognitive impairments visually comprehend form information.
"Applying role="heading" to an element causes an AT (like a screen reader) to treat it as though it were a heading. If there is more than one heading on the page and the heading hierarchy is defined through the visual presentation, the aria-level attribute should be used to indicate the hierarchical level of the heading."
<h3 role="heading" aria-level="3">Pink Roses</h3>
$59.00 SALE
Enjoy floral bouquets with our unique collection of florals. Pink Roses Bouquet is a beautiful carefully curated selection of pink roses that comes with 12 stems.
NOTE: Always use use semantic HTML form controls like button, input, select, and textarea rather than a div or a span element to be recognizable to screen readers. If you use a div or span, then include a role attibute such as: role="form" See Figure D
"The WCAG Success Criterion 4.1.2: Name, Role, Value is primarily for Web authors who develop or script their own user interface components. For example, standard HTML controls already meet this success criterion when used according to specification."
"Use an HTML <form> element to contain your form controls, rather than the ARIA form role, unless you have a very good reason. The HTML <form> element is sufficient to tell assistive technologies that there is a form. Use an aria-label on the form to provide an accesible name." - MDN Mozilla
<divrole="form"aria-label="Payment"></div>
<formaria-label="Payment"></form>
Figure D: Use an HTML <form> element to contain your form controls.
NOTE: The examples below integrate numerous WCAG Success Criteria that relate to forms and their content.
| Product | Details | Remove | Quantity | Total |
|---|---|---|---|---|
![]() |
Pink Roses
1 Dozen |
Remove Item Remove from cart |
$50.00 |
To add a shipping address, please fill out the form below.
Required fields are marked with a *
| Subtotal | $50.00 |
| Shipping | $5.32 |
| -$0 | |
| Total | $55.32 |
|
|
|