Results 1 to 1 of 1
Jun 17, 2006, 23:02 #1
- Join Date
- May 2006
- Ventura, CA
- 0 Post(s)
- 0 Thread(s)
Going International With Your Web Forms Guide
First off, a good deal of the content presented here is thanks to Isaac Forman
One of the areas that is kind of sparse these days is making your web forms accessible to international users. As the web is ever expanding, so is the international base of users acessing your site. However, do you know that your forms may be drawing away some users? Let's take a look at some issues:
Some people may not be aware that they need to use latin letters, or are simply not sure how to do so. If you want to compensate for this, you'll need to setup your database to recieve, as a recommendation, utf8 encoded information. For MySQL, you can set this on your entire database (this way you won't have to worry much about what kind of data your recieve, but at the same time you'll increase the storage size by using multi-byte characters). You can get really picky if you want, and set encodings on specific tables/columns). For MySQL, consult the section on Specifying Character Sets and Collations.
Traditional American names are in the form of First Name and Last Name. However, ponder for a moment the Japanese naming system. A native Japanese person is generally called by their family name (example: Tanaka-san), and the actual "First name" as people would call it, is only used between close friends (and I mean REALLY close). So in this case, First/Last name might not be exactly what you're looking for. I recommend the titles of "Family Name" and "Given Name" to make things more locale aware.
The typical US phone number is 10 digits ( (111)111-1111 ). A common mistake to make is to restrict the field to 10 digits. However, international phone numbers can very in length, to 11 digits and above. However, a common problem is that without the international dialing code, you will be unable to dial the client's phone number. In order to help prevent this, I recommend linking a requirement for a + symbol followed by a numeric, ended by a space for the dialing code, when a person selects a non-us country for their phsyical address. You can use a simple regex such as:
To check for that particular format. Also please remember try and keep an "either/or/both" case between phone and email. Some people just prefer email contact, and don't want to give their phone number out.
Nothing fancy here, I just recommend calling it "physical address" or some such. City is also a pretty standard naming, so there shouldn't be a problem there.
Oh, this one's easy right? I just name it "State/Province" and I'm all set right? *bzzt* wrong! I bet you're all wondering here going "huh"? Well, to a major disbelief, there are actually countries, such as Israel, that don't even HAVE states! I half-recommend having a preset term that the user can enter so as not to have blank forms, and validate the entire form is filled out. This can be something like "-none-" or so. Also, don't do that horrible "Your state abbreviation is not 2 characters!" thing! Since Sitepoint is based out of Australia, I'm sure some of them will come after you with pitchforks because their 3 character state abbreviations don't work !
Here's another one too. Think it's as easy as saying Postal Code instead? Yah, you need to do that, but force it as required and kiss your New Zealand customers goodbye! There are also countries that don't have postal codes as well! Not only that, but there are countries who have postal codes more than 5 digits, so don't go restricting that one either! Just as before, in order to validate the form is fully filled out, I generally have a preset value (such as 0, or 00000) that the user can enter to specifiy lack of a postal code.
If you want a somewhat comprehensive list of countries, you can consult the US Postal Service Listing. There's probably also people that have taken this list and created a database table/server side language code to automatically create this beast for you. Allthough official names used by the US postal service and Official names recognized by the Country themselves can be different. I suggest the addition of an "other" box to help users from such countries fill out your form.
I hope this guide proves usefull for people that were just confused as I was walking into this international users thing. As always I welcome more additions to this guide, and hope it grows to be extremely usefull! Since I also couldn't figure out a place to put it, check out Framk's Compulsive Guide to Postal Addresses to see the beast that is international mailing addresses!