O'Reilly logo

Mastering HTML5 Forms by Gaurav Gupta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Validation of Forms

Form validation has always been tricky and painful for developers since the Web was born. Before HTML5, it was a nightmare for developers to write lines of code for validating forms to get the desired information from the user.

In this chapter, we will cover the following topics:

  • Validation, their benefits, and their types
  • HTML5 <input> and attributes used in validations
  • The difference between JavaScript and HTML5 validations with an example
  • Validation constraints and supported APIs (Application Programming interface)
  • Default error messages displayed by the browser

Form validation

Validation of a form is a series of checks and notifications that guides a user as to what is required as an input while submitting information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required