validate

validates a DatePicker control

boolean validate(boolean silent,string|Date validateValue);

Parameters

silentbooleanoptional, if true - the method will return the result of validation without calling validation events and without modifying the control visually
validateValuestring|Dateoptional, the value to be validated. If not specified, the method validates the current value of the control

Returns

booleanthe result of validation: true - if a control is valid, otherwise false

Example

// the method validates the specified value
form.getItem("datepicker").validate(true, "03/10/20"); // -> true/false
 
// the method validates the current value
form.getItem("datepicker").validate(true); // -> true/false

Details

When calling without parameters or setting the silent parameter to false, the method invokes the BeforeValidate and AfterValidate events and visually modifies the control.

// the method validates the specified value
form.getItem("datepicker").validate(false, "03/10/20"); // -> true/false
 
// the method validates the current value
form.getItem("datepicker").validate(); // -> true/false
Change log

The silent and validateValue parameters are added in v7.0

Back to top