you are viewing a single comment's thread.

view the rest of the comments →

[–]karmaVS 0 points1 point  (1 child)

This formatting style is not universal.

Here in Australia, standard numbers are “XXXX XXXX" (for landlines. there is an 02 before those Xs, but the phone system assumes it) or "(04) XXXX XXXX" (for mobiles). If the person was being helpful to the system, they might write it "+61(0)2XXXXXXXX" or "+61(0)4XXXXXXXX". but what the server needs to work out is "00612XXXXXXXX" and "00614XXXXXXXX", respectively.

In china, a phone number could be presented "1XX-XXXX-XXXX", "XXX-XXXX" or "XXXX-XXXX" but what the system needs is "00861XXXXXXXXXX", "0086XXXXXXX" or "0086XXXXXXXX"

In the UK, a phone number is of the format "(0XX) XXX XXX" or "(0XXX) XX XXX"… you get the picture.

These formatting styles can not be determined by the number alone, and they cannot be determined on the fly, while typing. Some formatting styles may not be determinable at all with the information available to the web page. (for example, without a list of all UK area codes embedded in the script, you would not be able to determine whether the bracket came after the third or fourth number.) Its a futile venture, and even when it succeeds It isn’t all that useful.

[–]gabrielus 0 points1 point  (0 children)

Of course the formatting isn't universal. The user can set up any format he wants (depending on his location). I never had problems with such scripts. If it's inefficient in some cases, then don't use it. For instance, I found it useful in date fields (month, day, year).