Search.../

validity

Gets a ValidityState object that contains detailed information about the validity states of the element.

Type:

ValidityStateRead Only
Mixed in from:$w.FormElement

Related Content:

Was this helpful?

Log ValidityState info

Code Example

Copy Code
1let validityObj = $w("#myElement").validity;
2
3let customError = validityObj.customError; // true
4let valid = validityObj.valid; // false
5let valueMissing = validityObj.valueMissing; // false
6let typeMismatch = validityObj.typeMismatch; // false
7let patternMismatch = validityObj.patternMismatch; // false
8let tooLong = validityObj.tooLong; // false
9let tooShort = validityObj.tooShort; // false
10let rangeUnderflow = validityObj.rangeUnderflow; // false
11let rangeOverflow = validityObj.rangeOverflow; // false
12let fileNotUploaded = validityObj.fileNotUploaded; // false
13let stepMismatch = validityObj.stepMismatch; // false
14let badInput = validityObj.badInput; // false