Phone Number Verifier
Pretty cool Greg_Deckler . I can't believe this doesn't exist yet! A silly question; why do you need to check the len() of the parts? Didn't you do that in creating the variables? Also, what if they add an extra digit to the end?
Now if you could create a check for NZ phone numbers you would be a genius (they don't have consistent formatting or length).
- Greg_Deckler5 years ago
Community Champion
AllisonKennedy - I guess my thinking was to be thorough. I think it comes into play if the numbers are short. So, for example you grab the last 4 digits but there are only 3 digits to grab. I don't know, like most things I create, they can almost always be optimized! π
- AllisonKennedy5 years ago
Community Champion
Greg_Deckler You're like me, always over thinking and over engineering things. π Now you've got me too interested in this one, lol.
OK, so your LEN check is required if they for example type:
800-588-230
and miss the last digit (but everything else passes the check), so perhaps it is needed after all.
I still have one scenario that needs fixed in your formula, what if they type:
800-588-23001
That's not a valid phone number, but passes all your checks.
Also, being a non-US resident now, I'd love to see it handle this format:
1-800-588-2300
as valid (or even tell me three cases: "Valid No Country Code", "Valid with Country Code", "Invalid") but now I'm just getting picky.