Validation

It is possible to use HTML5 to inform users if they have entered information correctly. This is known as “form validation”.

Traditionally, form validation occurs with JavaScript, but HTML5 includes these features.

Validation helps ensure the user enters information correctly and with the correct “types” of data. Validation before submitting a form helps reduce resource usage on a server and enables users to more quickly see if there are errors in their form.

An example of form validation is the required attribute. Try pressing the ‘Submit’ button before entering any text:

NOTE: This type of validation may not be supported on all browsers (i.e. Safari), so it may be necessary to include other types of form validation (for example - JavaScript).