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).
I learned from a cashier to type 00000 and it has always worked.
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.
Include a field for the country that is autofilled via Geolocation API or geoip if that's unavailable.
Or just don’t try to be too clever.
That gets around countries that consider their postal code database a licensed dataset.
From UI side, I’d probably not autofill, but add autocomplete (e.g. using <datalist>¹). This way you can still have browser autofill the user’s address if saved (do also set the autocomplete² props correctly!), and suggest one or multiple variants you have in your database, and let the user fill it out manually still, without having to find and click “My address isn’t here”.
¹<datalist>: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
(quick note re: compat; Firefox does support it for the text fields, check the table at the bottom)
²autocomplete: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
> From those 5 characters you can determine the city, the state, and the country.
You can't infer the country from a postcode.
I did a very brief search, and none of the commercial offerings I could test recognised the postcode of the Eastern European neighbourhood I was born in. Also, like half of African countries don't have postcodes. It's just not a good system.
Even if they fixed that, there are other issues. (You pretty much need to cross-reference it with a database, which assumes said database even exists.)
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.
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.
That said, the obvious solution is <country> <post code> where <country> is prepopulated from geo-ip or browser signals or similar.
Any company able to do business in multiple jurisdictions, well, that's just the kind of extra thing they can handle.
For an enormous amount of sites and for an enormous amount of users this is an improvement and the general reaction here is nitpicking and this self-evident charge that it's US-centric. So what. The principle would apply in most places.
In Costa Rica, there are no addresses but there are (now) post codes. You would have to take that into account to do business there. If this doesn't apply to you then it doesn't apply to you.
It's not like the internal US market is small. This solves a problem for a lot of people in a lot of cases.
The page itself specifically says "and country", however that too doesn't work. Other non us countries may have the same postal codes, or in my case mine is 4 digits, and I had to figure out that "oh, this is us only and it doesn't work at all for me", which was just entirely a waste of time.
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.
United Kingdom
Great Britain
Britain
England
The filtering value is big as you said, and the model year as a first filter is easy to type in, and probably gets you reasonably close if you're off-by-one. Accidentally picking an '05 Sonata instead of an '04 probably has similar parts, but if you pick Honda instead of Hyundai, you're way off in Wonderland.
E.g. trying to enter a Canadian postal code in a US zip code field fucks a lot of things up. Very frustrating for Canadians trying to buy gas in Washington when the pump asks for a zip.