> For the complete documentation index, see [llms.txt](https://docs.gapvelocity.ai/webmap/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gapvelocity.ai/webmap/general/frontend/documentation/webforms-angular-components/web-components/kendoui-components/comparevalidator.md).

# CompareValidator

Adds support for \[System.Web.UI.WebControls.CompareValidator]  [<mark style="color:orange;">https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.comparevalidator?view=netframework-4.8</mark>](https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.comparevalidator?view=netframework-4.8)

Allows to compare the value entered by the user in an input control with the value entered in another input control, or with a constant value.

### **Implementation Details:**

**Component Selector:** ‘wm-compare-validator’

**Kendo UI Component:** <mark style="color:orange;">N/A</mark>

## **Class inheritance**

CompareValidatorComponent extends [<mark style="color:orange;">BaseValidatorComponent</mark>](/webmap/general/frontend/documentation/webforms-angular-components/web-components/base-components/basevalidator-component.md)

## **PME Support**

### **Properties**

| **Property**             | **Get/Set** | **Details**                                                                                                                      |
| ------------------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------- |
| ControlToValidate:string | Yes         | ID of first control to compare                                                                                                   |
| ControlToCompare: string | Yes         | ID of second control to compare                                                                                                  |
| ErrorMessage:string      | Yes         | Message showed in validator if result of comparation is not true and text property is empty                                      |
| Text:string              | Yes         | Message showed in validator if result of comparation is not true                                                                 |
| Operator:string          | Yes         | Text with one of next options: NotEqual,GreaterThan,GreaterThanEqual,LessThan,LessThanEqual,Equal                                |
| Display:ValidatorDisplay | Yes         | Enum property with options Static, None, Dynamic                                                                                 |
| ValidationGroup:string   | Yes         | If is established the name of the validationgroup component only will validate controls with the same validationgroup associated |
| Hidden:boolean           | Yes         | Establishes if the validator shows or is hides                                                                                   |

### **Methods**

| **Methods**      | **Details**                                                                                                          |
| ---------------- | -------------------------------------------------------------------------------------------------------------------- |
| validateControl  | Return a boolean value based in comparing expressions attached in properties ControlToCompare and ControlToValidate. |
| applyComparation | Applies comparations based in assigned operator                                                                      |
| displayMesssage  | Shows value of text property or ErrorMessage property in case text property is empty                                 |

&#x20;
