---
feature_name: reportValidity()
chrome_version: 40
feature_id: 5433505009893376
---
Report Validity Sample
===
See https://googlechrome.github.io/samples/report-validity/index.html for a live demo.

Learn more at https://www.chromestatus.com/feature/5433505009893376

Background

This sample illustrates the use of reportValidity(), which provides a way to trigger <form> validation logic. If any of a <form>'s inputs are considered invalid, the offending inputs and the constraints that are imposed will be identified in the user interface. Additionally, reportValidity() returns a boolean value indicating whether all of the inputs in the <form> were valid or not.

In this particular case, the <form> contains one <input>, with two constraints: required, as well as minlength="4".