Form Accessibility - Basic Ways to Make Forms Accessible

Form Accessibility - Basic Ways to Make Forms Accessible

In the fast-paced digital era, accessibility is a key factor in ensuring that everyone, regardless of their abilities or disabilities, can navigate and interact with online content seamlessly. From websites to applications, developers and designers play a crucial role in creating an inclusive digital space. In this article, we will explore four essential aspects of digital accessibility: Labels, Error Feedback, Error Prevention, and Captchas/Re-Captcha.

Accessible Labels

Labels are fundamental elements in web design and application development, providing context and information to users, especially those relying on screen readers or other assistive technologies. Properly labeled elements such as forms, buttons, and images contribute significantly to a positive user experience.

For users with visual impairments, screen readers interpret text labels associated with different elements on a page. It is essential to use descriptive and concise labels that accurately convey the purpose or content of each form element. Developers should also ensure that form fields have corresponding labels, making it easier for users to understand the context and input information correctly.

These properly associated labels can be tested by clicking on the text that is associated with a form field.  If you click the text and the field is selected, then the field is properly associated and is most likely accessible for your users. 

Label Examples

Text Box

<label for="name">Full Name:</label> <input id="name" type="text" >

<label for="name">Full Name:
          <input id="name" type="text" />
</label>

Textarea

<label for=“comments">Additional Comments:</label>
<br><textarea id=“comments"></textarea>

Checkboxes

<label for=“in-person">
<input id=“in-person" type="checkbox" name=“course-type" value=“in-person“> In-Person
</label>

<label for=“online"><input id=“online" type="checkbox" name=“course-type" value=“online“> Online</label>

Radio Buttons

<label for=“online"
<input id=“online" type="radio" name=“registration-type" value=“online">Online
</label>

Select Boxes - Single Selects

 <select id=“state" name=“states">
             <option value=“va">Virginia</option>
             <option value=“az">Arizona</option>
             <option value=“md">Maryland</option>
             <option value=“tn">Tennessee</option>
</select>

Select Boxes - Multi Select

 <select id=“state" name=“states" multiple>
             <option value=“va">Virginia</option>
             <option value=“az">Arizona</option>
             <option value=“md">Maryland</option>
             <option value=“tn">Tennessee</option>
</select>

Buttons - Submit or Reset

<input type="submit" name="submit" value="Submit Search">

Accessible Error Feedback

Error feedback is crucial for all users, but it is especially important for those with cognitive or learning disabilities. Providing clear and concise error messages helps users understand what went wrong and how to correct it. Color alone should not be the sole indicator of an error; instead, use text and icons to convey the message and when possible, place the focus on the first error field or first error message for your users.

Additionally, consider offering suggestions on how to fix the error and avoid generic messages like "Invalid input." Customized error messages that guide users towards the correct action contribute significantly to a more accessible and user-friendly digital environment.

Error Identification

Notifying the user of errors in their submission of a form is important and the best ways to ensure that they are being notified is by following the following guidelines:

  • Are available to the user immediately after submission
  • Errors should be programmatically-associated with the appropriate element
  • Error must be programmatically discernible for users
  • Message must be meaningful
  • Message must be visible to all users
     

Instruction Example

<p id=“matchup”>Password fields must match</p>
 <label for=“password”>Password:
            <input type=“password” id=“password” aria-describedby=“matchup” />
</label>

Accessible Error Prevention

Error prevention is a proactive approach to digital accessibility. By designing interfaces that minimize the likelihood of errors, developers can create a smoother user experience for everyone. Techniques such as input validation, confirmation dialog's, and clear instructions can prevent users from making mistakes in the first place.  It is also important if possible that you provide a list of information that your user will need to complete the form.  This is important when you have information such as a specific ID number (Social Security Number, University Employee Number, Medical Record Number, etc.) that the user might not know off the top of their head.

For example, validating form inputs in real-time can help users correct errors on the spot, reducing frustration and enhancing the overall user experience. Clear and concise instructions throughout the user’s journey can also contribute to error prevention by guiding users through the process without confusion.

It is also helpful to allow autocomplete to be used by our users to help reduce errors from typing.

Autocomplete Example

<label for="name2">Name:
          <input id="name2" type="text“ autocomplete=“on"
</label>

Accessible Captchas

While captchas are commonly used to differentiate between human users and automated bots, they can pose challenges for individuals with disabilities. Visual captchas, which rely on identifying distorted text or images, can be particularly difficult for users with visual impairments.  Screen reader users can sometimes not be able to complete the Captcha activity and therefore not be able to submit the form.

To address this, consider incorporating alternative captcha options, such as audio captchas or logic-based puzzles, to ensure that users with disabilities can still access and interact with your platform. Striking a balance between security and accessibility is crucial to creating an inclusive online environment.
It is advised that you use Captchas limitedly and only when it is 100% necessary due to captchas are considered a cognitive function test and could limit users, not just of assistive technology from being able to submit the form with success.  If you believe a captcha is needed, then contact the Digital Accessibility Coordinator for help!

Conclusion

Incorporating accessibility features into digital design and development is not just about compliance; it's about creating an inclusive and welcoming online space for everyone. By focusing on labels, error feedback, error prevention, and captchas, developers can contribute to a more accessible digital landscape, ensuring that technology serves users of all abilities. As technology continues to evolve, prioritizing accessibility will become increasingly important for fostering diversity and inclusivity in the digital realm.