You use the Validation Rules dialog box to define rules that check the validity of values entered into specific controls at runtime and display error messages when the validation fails.
You display the Validation Rules dialog box by selecting a control on the Layout board and clicking the browse button next to the Rules field in the Validation group in the Configure Element task panel.
Note
The Rules field in the Validation group in the Configure Element task panel is enabled only when you have selected a control that is bound to a field. You bind a control to a field in the Define Data dialog box.
More information: Define Data Dialog Box
The Validation Rules dialog box contains the following items:
Item |
Description |
|
---|---|---|
Add Row |
Adds another row to the list. You can then define the condition and value against which you want to validate the control at runtime. The control value must pass all the validation conditions defined in all the rows of the Validation Rules dialog box to be successfully validated. |
|
Delete Row |
Removes the highlighted row from the list. |
|
Move Up |
Moves the highlighted item one place up in the list, changing the order in which the validation rules are applied. |
|
Move Down |
Moves the highlighted item one place down in the list, changing the order in which the validation rules are applied. |
|
Condition |
The condition according to which to validate the field value. The available conditions depend on the field type. |
|
String |
|
|
Boolean |
|
|
Number |
|
|
Date/Time |
|
|
Value |
The value against which to validate the control at runtime. You can enter a value, select a field from the dropdown list, or choose Define expression from the dropdown list to define a value using the Dynamic Expression Editor dialog box. The Value field is not relevant if the selected condition is Is blank, Not blank, Is true, or Is false. |
|
Error Message |
The error message to be displayed at runtime if the control fails validation. The way in which the error message is displayed depends on the specific runtime implementation. |