JavaScript/jQuery Validator - EmailRule
A validation rule that demands that the validated field match the Email pattern.
import { EmailRule } from "devextreme/ui/validation_rules"
Type:
message
Specifies the message that is shown if the rule is broken.
Type:
Default Value: 'Email is invalid'
An error message can be specified as follows:
Hard-code the message
index.js- $(function() {
- $("#textBox").dxTextBox({ ... })
- .dxValidator({
- type: "email",
- message: "My custom message"
- });
- });
Hide the message
index.js- $(function() {
- $("#textBox").dxTextBox({ ... })
- .dxValidator({
- type: "email",
- message: ""
- });
- });
Display the editor's name in the message
index.js- $(function() {
- $("#textBox").dxTextBox({ ... })
- .dxValidator({
- name: "Mail address", // The error message will be "Mail address is invalid"
- validationRules: [{
- type: "email"
- }]
- });
- });