Hi friends,
I want a solution that validate the telephone number formats for all countries. My client wants to validate phone number from all over country. I have few country formats but how can I validate all country formats.
Please reply ASAP if anyone faced the same issues or if anyone know any ready made tool/webservice.
Validate countries telephone numbers
Moderator: General Moderators
-
ashishsoni
- Forum Newbie
- Posts: 1
- Joined: Mon Feb 08, 2010 4:03 am
Re: Validate countries telephone numbers
This could get difficult as for example in England we have at least 5 different phone number styles / numbers for different purposes (01 numbers, 02 numbers (basically the same as 01 so probs could validate the same but is business only), 0800, 08000 - and then mobiles)
For the UK at least this may help :
uk phone number validation with regex
Not done this myself so not 100%
I'm not sure you'll get a standardised one for every country unless you forcibly don't allow spaces, dashes, brackets etc and try and get them all to conform. Though, if your validating the number (so no letters etc) are you also going to verify the number (so its real and not 01234 567890 ? )
For the UK at least this may help :
uk phone number validation with regex
Not done this myself so not 100%
I'm not sure you'll get a standardised one for every country unless you forcibly don't allow spaces, dashes, brackets etc and try and get them all to conform. Though, if your validating the number (so no letters etc) are you also going to verify the number (so its real and not 01234 567890 ? )
Re: Validate countries telephone numbers
Is it worth the effort?
Ok when writing an email address, but telephone number?
Ok when writing an email address, but telephone number?
Re: Validate countries telephone numbers
Sometimes thats just what is needed (Though often its optional) Government sites require it if you're signing up to things here. I've even had to put in a passport number for an online game (Though silly system accepted *papa wrote:Is it worth the effort?
Ok when writing an email address, but telephone number?
Re: Validate countries telephone numbers
I can buy the argument for government sites and such but sometimes it's just overkill. For example when registering on a site that forces you to choose a state in the US you live in even though you live in Europe..aravona wrote:Sometimes thats just what is needed (Though often its optional) Government sites require it if you're signing up to things here. I've even had to put in a passport number for an online game (Though silly system accepted *papa wrote:Is it worth the effort?
Ok when writing an email address, but telephone number?)
Very accurate data.. Not
Re: Validate countries telephone numbers
I agree, its often more annoying than anything. I can understand using it for online shopping - sometimes if your delivery is going to need you to be in then they'd call and let you know.papa wrote:
I can buy the argument for government sites and such but sometimes it's just overkill. For example when registering on a site that forces you to choose a state in the US you live in even though you live in Europe..
Very accurate data.. Not
However like I said in my first post. For England alone (not necessarily including phone number formats for Scotland, Wales and N.Ireland) You need to validate the number is 01 or 02 or 07 or 08 and pretty much nothing else. Then validate the area code (in the Uk thats 5 numbers) followed by 6 numbers and then if its an 0800 or 08000. To be honest, per country you've got you're work cut out.