You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api-reference/10 UI Components/dxValidator/8 Validation Rules/CompareRule/CompareRule.md
+132-3Lines changed: 132 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,143 @@ generateTypeLink:
7
7
---
8
8
---
9
9
##### shortDescription
10
-
A validation rule that demands that a validated editor has a value that is equal to a specified expression.
10
+
A validation rule that requires validated values to match a specified expression.
11
+
12
+
---
13
+
To specify a comparison expression, define the [comparisonTarget](/api-reference/10%20UI%20Components/dxValidator/8%20Validation%20Rules/CompareRule/comparisonTarget.md'/Documentation/ApiReference/UI_Components/dxValidator/Validation_Rules/CompareRule/#comparisonTarget') function. Validator compares values to this function's return value. To configure which comparison operator Validator compares values to, specify the [comparisonType](/api-reference/10%20UI%20Components/dxValidator/8%20Validation%20Rules/CompareRule/comparisonType.md'/Documentation/ApiReference/UI_Components/dxValidator/Validation_Rules/CompareRule/#comparisonType') property.
To specify the expression that the validated field must match, set the rule's [comparisonTarget](/api-reference/10%20UI%20Components/dxValidator/8%20Validation%20Rules/CompareRule/comparisonTarget.md'/Documentation/ApiReference/UI_Components/dxValidator/Validation_Rules/CompareRule/#comparisonTarget') configuration property. Assign a function to this property. The validated value will be compared to the function's return value. The comparison will be performed by using the operator that is set for the [comparisonType](/api-reference/10%20UI%20Components/dxValidator/8%20Validation%20Rules/CompareRule/comparisonType.md'/Documentation/ApiReference/UI_Components/dxValidator/Validation_Rules/CompareRule/#comparisonType') property.
0 commit comments