validate()
validates form fields
validate(silent?: boolean): boolean;
Parameters:
silent: boolean
- optional, iftrue
- the method will return the result of validation without calling validation events and without modifying the form visually
Returns:
The result of validation: true
, if a form is valid; otherwise, false
.
Example
const result = form.validate(true); // -> true/false
Related sample: Form. Validate
Starting with v7.0, the method validates only the required fields or the fields that contain validation rules.
When called without the silent parameter, the method invokes the BeforeValidate and AfterValidate events and modifies the form visually.
const result = form.validate(); // -> true/false
Change log:
The silent parameter is added in v7.0.