Name
FormValidity — the validity of a form control
Synopsis
The validity property of a
FormControl refers to a FormValidity object that is a live
representation of the validity state of that control. If the
valid property is false, the control is not valid, and at
least one of the other properties will be true to indicate the nature of the
validity error (or errors).
Form validation is an HTML5 feature that, at the time of this writing, is not yet widely implemented.
Properties
readonly booleancustomErrorA script called
FormControl.setCustomValidity()on this element.readonly booleanpatternMismatchThe input does not match the
patternregular expression.readonly booleanrangeOverflowThe input is too large.
readonly booleanrangeUnderflowThe input is too small.
readonly booleanstepMismatchThe input does not match the specified
step.readonly booleantooLongThe input is too long.
readonly booleantypeMismatchThe input is of the wrong type.
readonly booleanvalidIf this property is
true, the form control is valid, and all the other properties arefalse. If this property isfalse, the form control is not valid, and at least one of the other properties istrue.readonly booleanvalueMissingThe form element was
required, but no value was entered.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access