New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PhoneUS Method isn't accurate #2126
Comments
Hi @itstabish, Thanks a lot for filing this issue! Would you like to write a patch for this? I'd be more than happy to walk you through the steps involved. |
Hey buddy, I have no idea how to fix that stuff. I have no idea about
coding :(
…On Sun, Mar 18, 2018, 3:48 AM Brahim Arkni ***@***.***> wrote:
Hi @itstabish <https://github.com/itstabish>,
Thanks a lot for filing this issue! Would you like to write a patch for
this? I'd be more than happy to walk you through the steps involved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2126 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AhyoS6kK3VGanMWter_lPBCGkl1t46_Hks5tfZKggaJpZM4RdtpN>
.
|
No worries. I don't know much about US phone numbers and how they should be validated, so I will let this issue for anyone experienced in validating these phone numbers and interested in fixing it. Thanks! |
Let me take a moment to argue that 555-555-5555 is a valid number. According to the Wikipedia page on the North American Number Plan (NANP), a phone number is in the form NPA-NXX-xxxx. The NPA, or numbering plan area code, can start with digits 2-9 and have 0-9 as the second and third digit, so the first 555 is valid. The NXX, or central office exchange code, has the same rule but the third digit cannot be 1 if the second digit is 1, so the second 555 is valid. And finally, there's this quote:
So, all that being said, the number 555-555-5555 is valid. But, I would argue that for the next version of JQuery Validation, that the phoneUS method be renamed to phoneNANP because it covers 20 countries. Then we could use the List of North American Numbering Plan area codes to create country-specific methods. I concede that on that page of area codes that the NPA 555 is "Reserved for directory assistance applications, not used". But a lot of other aren't used either. |
Thanks a lot for the detailed answer. We really appreciate it.
I'm +1 for changing the name of the method in the next major version.
Can't we configure the method to validate only a specific range of area codes? like it is done for |
Yes, exactly what I was thinking. |
Subject of the issue
PhoneUS Method is supposed to validate phone numbers to ensure they follow the 9 digit protocol. Phone numbers cannot be all 1's or a series of consecutive numbers such as 1234567. This is enough of a deterrent. However, yesterday, I came across a form, that when filled with the value 555 555 5555, validated as correct. Of course, this form IS incorrect.
Your environment
1.16.0
Chrome 63.0.3239.132
Steps to reproduce
Visit https://jsfiddle.net/ssguf2jy/
Fill in the phone number as 555 555 5555
Expected behaviour
An error should appear to the right of the field saying "x Please specify a valid phone number"
Actual behaviour
A check mark appears to the right of the field that denotes valid data.
The text was updated successfully, but these errors were encountered: