Heykuki News

TopNewBestAskShowJobs
TopNewBestAskShowJobs
Ask HN: Address Form With No City State (just Zip Code)
2 points
Johngibb
15 years ago
TL;DR; How do I automatically infer city/state from zip code, and ask for clarification if ambiguous?

I'm building a website that needs to collect the user's address, but I absolutely abhor typing in city, state, and zip code. It seems redundant.

However, I'm aware that there are sometimes more than one city that corresponds to a single zip code. Apple's checkout page has an interesting solution: when you type in the zip code, they perform an AJAX lookup, and show you the city state if it's not ambiguous, or give you a drop down if it is (see: http://www.lukew.com/ff/content/apple_checkout_zip.gif).

Has anyone built something like this? Is there a good database or API available for determining cities and states from a zip code?

8 comments