Closed vishal-gits closed 6 months ago
What could be a solution to restrict for an input field of phone,
Generally use a string
phone numbers aren't really numbers. you will run into trouble if you try and save a phone number into e.g. an int column
yes, you are right, i viewed other codes doing the same, and for strictly restricting to digits as strings, i can couple it with regex. also since phone numbers have different formats with respect to different countries, so cannot be generalized and keep it custom.
Is there a method available in yup to limit the number of integers in the input box.
phone: yup.number().max(10), This actually specifies the number amount , how can I specify the number of digits .
What could be a solution to restrict for an input field of phone, so that it is a number of 9 digits.