ValidityState
Summary
Represents a validation state of an input element.
Properties
- customError
- The element’s custom validity message has been set to a non-empty string by calling the element’s setCustomValidity() method.
- patternMismatch
- Returns whether the input field value does not match the rules defined by the pattern attribute.
- rangeOverflow
- Returns whether a value is greater than the max attribute on an input control.
- rangeUnderflow
- Returns whether a value is less than the min attribute on an input control.
- stepMismatch
- Returns whether the input field value does not fit the rules given by the step attribute.
- tooLong
- Returns whether an input field’s value is longer than is allowed by the maxlength attribute.
- typeMismatch
- Returns whether the input field value is not the correct syntax.
- valid
- Returns whether the input field value has any validity errors.
- valueMissing
- Returns whether a value has not been entered in an input field that is required.
Methods
No methods.
Events
No events.
Related specifications
- W3C HTML5
- Working Draft
- WHATWG HTML
- Living Standard
Attributions
Mozilla Developer Network : [ValidityState Article]
Microsoft Developer Network: [validityState Object Article]