For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Interface ValidityState
badInput: boolean;
customError: boolean;
patternMismatch: boolean;
rangeOverflow: boolean;
rangeUnderflow: boolean;
stepMismatch: boolean;
tooLong: boolean;
tooShort: boolean;
typeMismatch: boolean;
valid: boolean;
valueMissing: boolean;
}
Properties
ReadonlybadInput
The read-only badInput property of the ValidityState interface indicates if the user has provided input that the browser is unable to convert. For example, if you have a number input element whose content is a string.
ReadonlycustomError
The read-only customError property of the ValidityState interface returns true if an element doesn't meet the validation required in the custom validity set by the element's setCustomValidity() method.
ReadonlypatternMismatch
The read-only patternMismatch property of the ValidityState interface indicates if the value of an , after having been edited by the user, does not conform to the constraints set by the element's pattern attribute.
ReadonlyrangeOverflow
The read-only rangeOverflow property of the ValidityState interface indicates if the value of an , after having been edited by the user, does not conform to the constraints set by the element's max attribute.
ReadonlyrangeUnderflow
The read-only rangeUnderflow property of the ValidityState interface indicates if the value of an , after having been edited by the user, does not conform to the constraints set by the element's min attribute.
ReadonlystepMismatch
The read-only stepMismatch property of the ValidityState interface indicates if the value of an , after having been edited by the user, does not conform to the constraints set by the element's step attribute.
ReadonlytooLong
The read-only tooLong property of the ValidityState interface indicates if the value of an or
The
ValidityStateinterface represents the validity states that an element can be in, with respect to constraint validation. Together, they help explain why an element's value fails to validate, if it's not valid.MDN Reference