Im reading through all these comments and it amazes me how the perfect is the enemy of the good, for many computer people.
Ofc there are edge cases. So since there exist a handful of edge cases where a zip code maps to two states, or the more frequent (but irrelevant in the US) case of two or more city names per zip code, we should make everyone suffer?
Ofc if you are making a web form you should ask for the zip code first, and auto complete state and city. Let the user edit them if they don’t like what you chose. Or do as some have suggested here and present the official USPS data as a drop down of 2 states or 2-3 cities; thats way better than having to type all of it.
And I curse everyone who thinks it’s a good idea to break zip code or phone number or OTP into multiple fields, or if you’re too lazy to set the input type to number.
Ofc there are edge cases. So since there exist a handful of edge cases where a zip code maps to two states, or the more frequent (but irrelevant in the US) case of two or more city names per zip code, we should make everyone suffer?
Ofc if you are making a web form you should ask for the zip code first, and auto complete state and city. Let the user edit them if they don’t like what you chose. Or do as some have suggested here and present the official USPS data as a drop down of 2 states or 2-3 cities; thats way better than having to type all of it.
And I curse everyone who thinks it’s a good idea to break zip code or phone number or OTP into multiple fields, or if you’re too lazy to set the input type to number.