Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating an International Telephone Number

Status
Not open for further replies.

iaresean

Programmer
Joined
Mar 24, 2003
Messages
570
Location
ZA
Hi All;

I would like to have a country list drop down, followed by a city/state/province list drop down that users will use to automatically generate the international number format for their telephone numbers.

For instance, if they selected South Africa followed by Western Cape they would get the following: +27 21
Thereafter they could just type their number as they would locally.

Does anyone know of such a solution around the web anywhere. I tried googling it, but to no avail. I guessed the javascript forum here would be a good place to continue my search.

Any and all help would be greatly appreciated!

Sean. [peace]
 
I have no idea, but the information of all local prefixes around the world must be of a considerable size, so I imagine there must be a database to hold that information.

So maybe using just javascript is not a good idea.

Cheers,
Dian
 
Look at this link. It lists the various country codes and describes the difference between IDD and NDD prefixes and when each is used.

Unfortunately it appears that the IDD prefixes are frequently changing in some countries and in some cases are assigned to specific phone carriers rather than regions so working with static information for IDD prefixes may not work well for a global application but may work well enough if you are dealing with specific countries that may not frequently change.

There is probably an online resource where the information can be gathered from, possibly in an automated fashion so that your app can remain up to date without constant manual attention but you will have to search around a bit.

You would want to set a value for the local country so that you can determine on the fly whether the IDD or NDD number is appropriate for the generated phone number.


At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top