JavaScript/jQuery 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
JavaScript
$("#myValidator").dxValidator("dispose"); $("#myValidator").remove();
Angular
HTML
<dx-validator #validatorVar id="myValidator"></dx-validator>
TypeScript
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()
Return Value:
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)
Return Value:
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()
Return Value:
See Also
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
off(eventName)
Parameters:
eventName:
Return Value:
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
off(eventName, eventHandler)
Return Value:
See Also
- Handle Events: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
on(eventName, eventHandler)
Return Value:
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)
Parameters:
events:
Return Value:
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.
Return Value:
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option(optionName)
Parameters:
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)
Parameters:
See Also
- Get and Set Options
- Call Methods: Angular | Vue | React | jQuery | AngularJS | Knockout | ASP.NET MVC 5 | ASP.NET Core
option(options)
Parameters:
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.
Return Value:
Feedback