message
Type:
Default Value: 'Value should be a number'
An error message can be specified as follows:
Hard-code the message
App.vue- <template>
- <DxTextBox>
- <DxValidator>
- <DxNumericRule
- message="My custom message"
- />
- </DxValidator>
- </DxTextBox>
- </template>
- <script>
- import 'devextreme/dist/css/dx.light.css';
- import { DxTextBox } from 'devextreme-vue/text-box';
- import {
- DxValidator,
- DxNumericRule
- } from 'devextreme-vue/validator';
- export default {
- components: {
- DxTextBox,
- DxValidator,
- DxNumericRule
- }
- }
- </script>
Hide the message
App.vue- <template>
- <DxTextBox>
- <DxValidator>
- <DxNumericRule
- message=""
- />
- </DxValidator>
- </DxTextBox>
- </template>
- <script>
- import 'devextreme/dist/css/dx.light.css';
- import { DxTextBox } from 'devextreme-vue/text-box';
- import {
- DxValidator,
- DxNumericRule
- } from 'devextreme-vue/validator';
- export default {
- components: {
- DxTextBox,
- DxValidator,
- DxNumericRule
- }
- }
- </script>
Display the editor's name in the message
App.vue- <template>
- <DxTextBox>
- <!-- The error message will be "Age should be a number" -->
- <DxValidator name="Age">
- <DxNumericRule />
- </DxValidator>
- </DxTextBox>
- </template>
- <script>
- import 'devextreme/dist/css/dx.light.css';
- import { DxTextBox } from 'devextreme-vue/text-box';
- import {
- DxValidator,
- DxNumericRule
- } from 'devextreme-vue/validator';
- export default {
- components: {
- DxValidator,
- DxNumericRule
- }
- }
- </script>
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.