Search.../

valid

Indicates if an input element's value is valid.

Description

The valid property indicates if an element's value satisfies all conditions to pass a validation check. This includes basic validity conditions, such as whether the element has a value if it is required, and those specified in its onCustomValidation() event handler, if you defined one.

Note that validations other than required, including custom validations, are not run on input elements when they don't have a value.

Type:

booleanRead Only
Mixed in from:$w.FormElement

Related Content:

Was this helpful?

Get whether the element is valid

Code Example

Copy Code
1let isValid = $w("#myElement").valid; // false