Home > Basic Functions > Validation > Compare Validator
Compare Validator
|
The Compare Validator is used to compare values in two different fields on the form, or compare the data entered to a specific type a data such as a Date.
The Compare Validator does not require that a field contain a value, it only validates if a value is present.
For example: Many forms ask the user to enter their email address then confirm the email address by entering it a second time to help the user avoid typographical errors. The Compare Validator is just the tool to use to solve this. The Compare Validator has four new attributes in the Validators Data Grid
- Operator: The values available here are:
- DataTypeCheck: Use this when comparing the user entered value with a specific Data Type such as a Date
- Equal: =; Compare value with another form field or with the Value to Compare. The remaining Operators share the same function.
- GreaterThan: >
- GreaterThanEqual: >=
- LessThan: <
- LessThanEqual: <=
- NotEqual: <> or !=
- Value to Compare: When “Control to Compare” is “<< None >>”, works with the Operator and Data Type to compare the user entered value.
- Control to Compare: Sets which form Field to Compare this Field to. Works with the Operator
- Data Type: When using the “DataTypeCheck” Operator forces the user to enter the proper type of data such as a Date or Whole Number
When the “Control to Compare” is not set to “<< None >>”, the field will not be part of the data sent by email or saved to the database.
In this example, we will use the Compare Validator to make sure the user enters their email address without typographical errors.
|
|
Compare to Field Validation Presentation |
|
This example validates a date entry field. |
|
Compare to Data Type Validation Presentation |
| This example validates the value is Greater than or Equal to 5 and is a whole number |
|
Value to Compare Validation Presentation |
See also
|