The correct validation schema for a numeric field based on the number of characters. #394
Replies: 1 comment 3 replies
-
I have found a solution. I changed the regular minLength and maxLength methods and they work the way I need them to |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone. I've encountered a problem with typing a form validation schema, where there's a numeric field that requires checking the number of entered characters. I found the following solution:
And it even works) But it looks odd.
I'm using a validator together with vee-validate and I'm getting a type error on the line:
handleSubmit is a validation method from vee-validate.
The fields of the schema are based on the iDevice interface.
From the schema, I derive the type:
I expect that tDevice overlaps with iDevice enough for a value of type tDevice to be valid for the type iDevice.
What is the most accurate way to validate the number of characters in a numeric field? I think my solution is incorrect (even though it works) and there's a proper way to do it.
Thank you for any assistance.
Beta Was this translation helpful? Give feedback.
All reactions