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 occurred with JavaScript, but HTML5 has added this feature.

Validation helps ensure the user enters information correctly and with the correct “types” of data. Validation before submitting a form to a server reduces server load 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 is not yet supported on all browsers (i.e. Safari), so it may be necessary to also include other types of form validation (Such as with JavaScript).