React Validator Methods
See Also
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
dispose()
After calling this method, remove the DOM element associated with the widget:
jQuery
$("#myValidator").dxValidator("dispose"); $("#myValidator").remove();
Angular
<dx-validator #validatorVar id="myValidator"></dx-validator>
import { ..., ViewChild } from "@angular/core"; import { DxValidatorComponent } from "devextreme-angular"; // ... export class AppComponent { @ViewChild("validatorVar", { static: false }) validator: DxValidatorComponent; // Prior to Angular 8 // @ViewChild("validatorVar") validator: DxValidatorComponent; removeValidator (e) { this.validator.instance.dispose(); document.getElementById("myValidator").remove(); } }
element()
An HTML element or a jQuery element when you use jQuery.
See Also
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
getInstance(element)
getInstance is a static method that the widget class supports. The following code demonstrates how to get the Validator instance found in an element with the myValidator
ID:
// Modular approach import Validator from "devextreme/ui/validator"; ... let element = document.getElementById("myValidator"); let instance = Validator.getInstance(element) as Validator; // Non-modular approach let element = document.getElementById("myValidator"); let instance = DevExpress.ui.dxValidator.getInstance(element);
See Also
instance()
See Also
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
off(eventName)
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
off(eventName, eventHandler)
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
on(eventName, eventHandler)
Use this method to subscribe to one of the events listed in the Events section.
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
on(events)
Use this method to subscribe to several events with one method call. Available events are listed in the Events section.
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option()
Gets all widget options.
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option(optionName)
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option(optionName, optionValue)
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option(options)
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
validate()
Validates the value of the editor that is controlled by the current Validator object against the list of the specified validation rules.
If you have technical questions, please create a support ticket in the DevExpress Support Center.