Adding Validation for Time of Accident Field
This validation ensures that a valid value is specified for the
Time of Accident field.
Procedure
-
Click the
Time of Accident field.
-
Click the
Validations tab on the control’s
Properties view.
-
Click the
Add New Validation button.
The
Define Validation dialog opens.
-
In the
Name field type the following:
-
Click the radio button
On Value Change.
-
Type the following JavaScript code in the
Script text area:
//Accident time must not be in the future
var accTime = this.getValue();
var now = new Date();
if(now < accTime){
false;
} else{
true;
}
-
Edit the text in the
Message area to the following:
Accident time must not be in the future.
-
Click
Finish.
Copyright © Cloud Software Group, Inc. All rights reserved.