Falsehoods programmers believe about postal addresses
Not every country has states. Not every address has a postal code. Here's what breaks address forms — and the country-aware field that fixes them.
- A two-letter (ISO) country code is required.
The US-shaped address form — street, city, State, ZIP — is the single most common way to lock out international customers. Change the country and the fields themselves should change.
The falsehoods
- Every address has a state or province. The UK and many countries don’t use one.
- Every address has a postal code. Hong Kong has none; parts of Ireland don’t either.
- Postal codes are five digits. UK postcodes like
SW1A 2AAare alphanumeric. - Fields are always in the same order. Japan writes the postal code and prefecture first.
- A US street/city/ZIP is enough everywhere. It isn’t.
How humaneforms handles it
The demo above is the real AddressField. Switch the country and watch the labels, the visible fields, and the field order change: pick Hong Kong and the postal and region fields disappear; pick Japan and the postal code moves to the top; pick the UK and “ZIP code” becomes “Postcode”. This is the field developers most dread building — and the reason the Pack pays for itself.
Get the Pack for the AddressField, or start with the free fields.