4.7.6 The CompareValidator tag
Description
The « CompareValidator » validator is used to compare the value entered by the user with another one.
Example
This validation checks that the « Salary » field value is higher than 0.
| Rendering |
|
XHTML settings | <bluage:CompareValidator id="salary_value_validation" forid="txt_salary" errormessage="Salary must be greater than 0" comparetovalue="0d" valuetype="double" operator="greaterthan" styleclass="error" /> |
| Screen activity diagram |
|
| Entities Diagram |
|
| Service activity diagram | N/A |
Tag attributes: reference
| Tag | CompareValidator |
| Description | Compares a field value entered by the user with another one (another field value or another entered value) |
| Diagram |
|
Tag attributes description
| Attribute | Required | Description |
| Id | Y | Unique tag ID in the page |
| forid | Y | ID of the item to be validated |
| errormessage | N | error message to display in case of validation error |
| styleclass | N | Error message to display style CSS class |
| comparetofield | N | Field ID with which a comparison is made |
| Comparetovalue | N | Constant value (it is a comparison with a static value) |
| valuetype | N | Comparison type : values to compare are converted into this type before comparison (integer, double, date, string, currency) |
| operator | Y | Comparison operator (equal, notequal, greaterthan, greaterthanequal, lessthan, lessthanequal ) |



