I am working on a validation script for form submissions as a side project. I was wondering what are the common formats for postal codes(zip code) and phone numbers outside the USA? I know the American Way of XXXXX-XXXX for postal zip code where the X are all numbers Phone Numbers: (XXX)XXX-XXXX or 1-XXX-XXX-XXXX Thanks for you input Eric
Don't hold your breath on the postcode issue, some nations don't have postcodes and where they exist the format can vary widely. To give an example in the UK I live at LS8 1DZ, am currently sitting at Y024 3DX and as a child my postcode was WR9 OHP (that is oh HP not zero HP). In Australia my postcode was 2022. Don't forget that for most of the world the US format is foreign Marcus [ April 22, 2003: Message edited by: Marcus Green ]
in Canada "postal codes" (not zip codes) look like this: T2Y 4T5 (letter # letter -space- # letter #). But their Phone #s are the same as in the US. My husband's from Trinidad -- phone #'s are the same, but they don't have zip codes. Looks like you've discovered the wonderful world of Internationalization (I18n). This thread over in the advanced forum has a lot of links about Internationalizing J2EE apps -- one of them might give you an idea of how to do what you need.... [ April 22, 2003: Message edited by: Jessica Sant ]
In Swizzleland its a 4 digit number as in: 8005 Zurich or CH 8005 Zurich For Germany i think its 5 digits: 23456 Dinkeldorf -- made up or D 23456 Dinkeldorf Notice in Europe it is common to stick a letter or two identifying the country in front of the post code. [ April 22, 2003: Message edited by: Barry Gaunt ]
I know the American Way of ... Phone Numbers: (XXX)XXX-XXXX or 1-XXX-XXX-XXXX
Yuck, no. All phone numbers (American or otherwise) use a "+" to indicate the country code and parentheses "()" to indicate a subdivision (area code, exchange, city code, etc.). +X (XXX) XXX-XXXX Anything else is a crime against good taste.
My thinking has always been that as soon as you get some validation going, somebody in some other country has a whole new wacky way of doing things. You won't be able to stay on top of it. So I always allow them to type in whatever they want and skip the validation. If the information is going to be always limited to certain regions (like, the US and Canada - or maybe Europe) then you can start engaging validation. Just my opinion.
Wi was going to do is have a country/region being checked that has a known format and then adjust the reg. exp. to that format. If the country is unknown with the format, the validation to that space will be skipped. As to the world standard, never going to happen because the USA would never follow,,,lol.... I wish we used metric, so much easier!
Joined: Mar 25, 2001
EP: ...metric... Yes, I much prefer a kilogram of phone numbers to a pound.
Originally posted by Marcus Green: an example in the UK I live at LS8 1DZ,
and I was thinking Indian PIN code must be like UK's postal code. AW Indian PIN code has format XXX XXX Ph No: if its metro city then upto 8-9 digits else generally its upto 6-7 digit number but just 12 yr back there were ph no. of 3 digits in smaller cities
Originally posted by Simon Lee: 8 pints in a gallon 14 pounds in a stone the list is endless...
But how many sixpence in half-a-crown? The U.S. is too metric where it counts. It's just nobody's managed to invent an automobile that's powered from plastic bottles of Coca-Cola! [ April 23, 2003: Message edited by: Tim Holloway ]
Customer surveys are for companies who didn't pay proper attention to begin with.
The U.S. is too metric where it counts Translation note for those who may be confused here - "too" is used here for added emphasis, as in "yes it is too!". This does not mean "too metric" == excessively metric. Even if it might sound that way. Personally, I'm all for the metric system, and wish the US used it more. But I'm not convinced the rest of the world is as committed to the idea as they claim. When's the last time someone said "I'll be ready in a kilosecond or two"? Though to be fair, a proper metric-style time system should probably be based around days or possibly years, to simplify as much as possible. SI and MKS just don't cut it for day-to-day use here.
It's been *many* years since I read it and I'm no particular fan of Hemingway, but folks might enjoy reading his short story A Day's Wait. Can't say more because that would spoil things.
Joined: Nov 08, 2001
Well I spent a good portion of today getting my validation script online. This is still not version 1 of my script. Just the basic concept. I thought I would post a link in here so you people can figure out what I am trying to do. I am linking you to the features page. You can see a preview by clicking on the link there. http://www10.brinkster.com/A1ien51/validate/features.htm I am playing around with the countries and the postal code, but that will take years to get it right!! LOL I am not looking for feedback and I am not advertising and please no one take this code since it is buggy as can be still!! Eric