WebAIM: Usable and Accessible Form Validation and Error Recovery

Usable and Accessible Form Validation and Error Recovery

Article Contents

  • Introduction
  • Building Usable Forms
  • Hiding Form Labels
  • Form Validation
  • Error Recovery
  • aria-invalid
  • Summary
  • Introduction

    Form validation ensures that web forms are filled out with all necessary information in the correct format. Error recovery guides a user to fix missing or improperly formatted information if detected. Form validation and error recovery can be implemented in a variety of ways, primarily either:

  • server-side—the form information is submitted and analyzed by the web server, and necessary feedback messages are written to a newly generated web page
  • client-side—form validation and error recovery are performed within the web client or browser using JavaScript and generated within the web page.
  • Advantages of server-side validation and error recovery include:

    • The form can be completed and submitted without interruption from validation alerts, errors, or warnings.
    • The user does not need to have scripting enabled in their browser.
    • Validation mechanisms are more difficult to bypass or modify, making it more secure.

    Advantages of client-side validation and error recovery:

    • Validation can occur in real time, before the user submits the form data to the server.
    • Functionality does not require server-side scripting.

    Some users may disable scripting in their browser. As such, developers should not require [...]

    Read article at webaim.org

    Article Taxonomies

    Categories: ,