International phone and address data?

I think this is a question with several parts. I am creating a membership site and want the accounts to be as international as possible.

  • What is the best way to collect phone numbers in a form that allows you to use international numbers? I do not worry about their storage, just collect and check. Now I have a drop-down list of countries in which the country code will be added, and then the confirmation number for us / can / uk based on the country code, and then the extension. They will be saved as strings in three fields for cc / number / ext. Does anyone have a better, solid solution for this, or perhaps seen in action anywhere?

  • The same goes for addresses. What is the best way? Address / City / State / Zip / Country or just lines? I would like to be able to sort them, so a single text field is not a good solution, although it is the most flexible.

    This is also important because we can send actual mail to our members. I mean a few members that I had for other services that had addresses in countries that I had never heard of, that even a woman at the post office could not determine if they were formatted correctly.

    / li>
  • I want to have geodata in db, at least in the country / state, for things like populating a drop-down list of states after selecting a country, standardizing the field, etc. Does anyone know of a large database that can be used as an application geodatabase?

+6
internationalization street-address
source share
3 answers

Checking the phone number - I'm not sure I would spend a lot of time on this. Numbering schemes change quite often (for example, while I was living in the UK, the phone numbers for London codes changed at least once, with a different replacement shortly before I moved there), but in Germany this (or, at least, itโ€™s used to be quite common, to increase the number of available phone numbers on this exchange, taking the old number and typing an additional number or two at the end.Thus, any assumption about this phone number format will change, and youโ€™ll end up playing catch-up If you insist on dividing the phone number into an international / regional code / main number, you will probably find that this is a very country-specific way of presenting information, so you will need an input mask to a large extent for each country and for a specific validation rules. Not to mention that in places like Germany, the area code can have from two to four digits, etc.

Regarding postal addresses, the most important suggestion I have is to ensure that you can accept non-numeric postal / postal codes, otherwise you will not be able to process addresses in Canada and the UK (and possibly elsewhere). This is a bit of a hobby for my horse, as I had several problems with sites in other countries that simply refused to allow me to enter a non-numeric zip code, and I had to resort to sending faxes using my address information, because I could not fill out an online application form. In my book, that is bad karma if you allow international customers ...

In addition, assuming that certain parts of the address (for example, state / county) and those requiring them, as a rule, have a greater headache than it costs. I will be tempted to offer a standard house number + street (to combine them, different languages, put the house number in different places, therefore it is not very good to separate them IMHO if you do not know how to collect them correctly, plus sometimes you will end up with the name houses instead of numbers), city and zip code, possibly with an optional county / state field. If you want to be truly useful to you as an international audience, offer an input field for free form, one text field for those addresses that do not meet our "standard" assumptions about how the address looks. And please make them big enough so that people with fairly long addresses do not go out of space ...

+2
source share

There is an international standard for phone numbers , but it leaves a lot of respite. Separators are optional, but limited by space, period, and hyphen. Parentheses (aka parentheses) should be placed around numbers, which are optional depending on who you type. For example, the area code is optional in some areas. I would provide a text box and let the user enter their number, however they want to.

For addresses, specify many fields and do not limit them. House numbers sometimes contain letters. Types of roads are sometimes written in full, and sometimes abbreviated. (St = Street, Ave = Avenue, etc.) I would provide drop-down lists where possible (state / province), but allow input of arbitrary shape when you do not have a list. When a user enters his address, he checks the security risks well, but you can leave the geographical check to the end. For example, if a user enters the postal code T8N 4E3 and selects Ontario as their province, the address is not valid because the given zip code is for Alberta. Show a friendly message to the user, telling them that they need to correct their address or contact you if he is right (a possible error in your code).

+1
source share

Address - just remember that itโ€™s not everywhere that you received states and postal codes. and if you have zip codes, they may be in a different format ( [0-9]{2}-[0-9]{3} here). (change: usually a mailing address with two address lines, city, state (optional), zip code (optional) and country in order).

So, with geodata - you can do sequential drop-down lists with states and cities, but assume that you will not cover every city. Why not show some of the Google maps and let users click there to mark their position?

0
source share

All Articles