We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Validation rule 'digit' in Vue Form Validator component is not working

Hello.

I tried to use the digit rule in vue form validator component,

but I encountered an error.



The number rule works fine. but, the digit rule is not working.


Can you please check this?

( I used the source code example below )

https://ej2.syncfusion.com/vue/documentation/form-validator/validation-rules/#validation-rules



OS: Windows 10 Pro x64 21H2

syncfusion version : 20.4.48

node.js version : 16.19.0



thanks.


3 Replies

UD UdhayaKumar Duraisamy Syncfusion Team March 2, 2023 11:35 AM UTC

Thank you for reaching out to us regarding your issue with the digits validation rule on our NumericTextBox component.


After reviewing the information, you provided, it appears that the digits validation rule you are trying to use is intended to validate whether the entered values are numbers. However, please note that the NumericTextBox component is designed to only allow numerical values by default and will not allow string characters.


To better assist you, we have created a sample using the TextBox component with the digits validation rule. Please find the sample in the attachment section. This should help you achieve your desired outcome.

rules: {

'age': { required: [true, "Age is required"],digits:true }

      },




Furthermore, we would like to apologize for any confusion caused by our documentation. We will correct the incorrect validation rule of "digits" to "digits" in our documentation and refresh it by the middle of March 2023.


We hope this information helps you to resolve your issue.


Attachment: quickstart_4cced47e.zip


KM kim minseok March 3, 2023 05:13 AM UTC

I used it for normal input, but I had to select a component, so I chose NumericTextBox component.

After changing "digit" to "digits", it works perfectly.


thanks  : )



UD UdhayaKumar Duraisamy Syncfusion Team March 6, 2023 04:16 AM UTC

We are glad that your requirement has been fulfilled on your end. We are always happy to assist you.


Loader.
Up arrow icon