UI Widgets Validator

A widget that is used to validate the associated DevExtreme editors against the defined validation rules.

Included in: dx.phonejs.js, dx.webappjs.js, dx.all.js

You can create the dxValidator widget using one of the following approaches.

  • jQuery
    Apply the dxValidator jQuery plug-in to an editor instance.

    HTML
    <div id="textBox1"></div>
    JavaScript
     $("#textBox1").dxTextBox({})
        .dxValidator({
            validationRules: []
        });
  • Knockout
    Apply the dxValidator binding to the div element that is bound to an editor.

    HTML
    <div data-bind="dxTextBox: { },
        dxValidator: { validationRules: [] }">  
    </div>
  • Angular
    Apply the dx-validator directive to the div element that represents an editor.

    HTML
    <div ng-controller="demoController">
        <div dx-text-box="{  }"
            dx-validator="{ validationRules:  }">  
        </div>
    </div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular library is also required.

See Also
See Also

The learn the validation rules that can be defined using the dxValidator widget for an editor, refer to the Validation Rules section.

The editors that are associated with the dxValidator widgets are automatically validated against the specified rules each time the event assigned to the editor's valueChangeEvent option occurs. In addition, several editors can be validated at once. To learn how to do this, refer to the Validate Editor Values topic.

See Also

View Demo

Configuration

An object defining configuration options for the dxValidator widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events exposed by this widget.

Validation Rules

This section lists validation rules that can be used within the dxValidator.