Validates the control value against all previously added validation types.
Syntax
var vRes = ctrl.validate();
Arguments
No arguments.
Return value
Returns an array with two values:
•result (the validation result, values: true or false);
•messageArr (the array of validation errors). If the result is true, then the messageArr array is blank.
Example
Validate the control and display validation errors if there are any using the JavaScript OnLoad event:
var ctrl = Runner.getControl(pageid, 'make');
var vRes = ctrl.validate();
if ( !vRes.result ) {
var message = "";
for (var i = 0; i < ctrl.validationArr.length ; i++) {
if ( vRes.messagesData[ ctrl.validationArr[i] ] ) {
message += vRes.messagesData[ ctrl.validationArr[i] ].join(" ");
}
}
alert( message );
}
See also:
•JavaScript API: Control object > getControl()
•JavaScript API: Control object > addValidation()
•JavaScript API: Control object > removeValidation()
•JavaScript API: Control object > validateAs()
•JavaScript API: Control object > invalid()
•"Edit as" settings: Validation types
•JavaScript API: Control object