US-centric. I typed a Mexico postal code (it’s five digits) and got routed to somewhere in Maine. So - yeah the whole “I can tell you’re in the US just by the zip code” premise is entirely flawed.
Yup, the second sentence in the post is incorrect.
> From those 5 characters you can determine the city, the state, and the country.
You can't infer the country from a postcode.
Should be titled "Put the Zipcode and country first".
Would be simple enough to have someone type the zip or postal code first, then move the countries that are known to have that zip code to the top of the drop down (still in alphabetical order), and all the other countries below that (also in alphabetical order).
Leave all the fields editable, i.e. the postal code only suggests, ranks, or prepopulates.
Seems like that would handle all the edge cases, including those where a zip code doesn't refer to one and only one city, or where a zip code has changed or been added to a country.
Yup. I typed my French ZIP code (code postal) and this guessed a US city...
But the author has a point. Combine it with some approximate country-level geolocate of the web client and this would work perfectly 99% of the time modulo edge cases like VPN users.
In the mid-1990's, I requested information from a major multinational corporation (IBM) that had a significant presence in my country. They somehow managed to mangle the six characters of a Canadian postal code, which alternates between letters and digits, into a five digit zip code. Making it even more perplexing, the envelope was addressed by hand and came from New York state. Some Americans seem to think that the rest of the world is a mirror of them, and will go through unusual contortions to maintain that belief. (To be fair: there is another level above that which is Anglo-centric, which allows for just enough variation between English speaking nations.)
I have seen websites that more-or-less takes the author's advice though. They are country specific. They are backed by the postal system's database. They present a list of addresses that match up with the postal code. They do not work very well when a particular address does not have a postal code. And yes, that happens.
Yeah, post codes are a huge pit of an implementation. Each country has their own way of presenting and formatting them, as well as additional validation rules (e.g. valid postal districts). This should be amazing (and is), but if you maintain such a validator you'll have a continuous stream of bugs where clients were able to make a mistake they shouldn't have been able to (often breaking downstream where it is hard to recover) or where you refuse to accept somebodies very real address and they are very personally upset (rightly so).
That said, the obvious solution is <country> <post code> where <country> is prepopulated from geo-ip or browser signals or similar.
The UI pattern is still stupid. You should be able to quickly enter forms like this on a keyboard.
When I look for a part for my car, I pick “Honda”, “Model Year”, “model”, “trim”.
With address forms, if I type “U” in a keyboard aware field, it defaults to “US Minor Outlying Islands”. Places that try to accommodate will put the US and Canada first.
If you asked country, first, you could utilize the postcode method. Some sites try to autocomplete street address which I personally find annoying as my street is a common streetname.
The best times are when US ecommerce sites try to confidently lint foreign addresses, even when they allow shipping there.
I've had them tell me I need 5 digits for my postal code in Norway, which uses 4 digits. I selected Norway in the shipping web form.
Or when they tell me special characters aren't allowed, yet the "special characters" are just letters in the Norwegian alphabet. My address contains ø. These aren't even unicode, they're in the extended 8 bit ascii set. Why are you linting these!?
These happen all the time. Thankfully our postal system recognises this and allows some substitutions (å=aa, ø=oe, æ=ae).