validate()
validates a SimpleVault control
validate(silent?: boolean, validateValue?: object[]): boolean;
Parameters:
silent: boolean
- optional, if true - the method will return the result of validation without calling validation events and without modifying the control visuallyvalidateValue: object[]
- optional, the value to be validated. If not specified, the method validates the current value of the control
Returns:
true
, if a control is valid; otherwise, false
Example
form.getItem("simplevault").validate(true);
// -> true/false
When called without the silent parameter or with this parameter set to false, the method invokes the BeforeValidate and AfterValidate events and modifies the control visually.
form.getItem("simplevault").validate(); // -> true/false
form.getItem("simplevault").validate(false); // -> true/false
Change log:
- The silent parameter is added in v7.0.
- The validateValue parameter is added in v8.2.