TL;DR; How do I automatically infer city/state from zip code, and ask for clarification if ambiguous?<p>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.<p>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).<p>Has anyone built something like this? Is there a good database or API available for determining cities and states from a zip code?
Here is a great post that was posted on here: <a href="http://uxmovement.com/forms/innovative-techniques-to-simplify-sign-ups-and-logins" rel="nofollow">http://uxmovement.com/forms/innovative-techniques-to-simplif...</a><p>And here is the link directly for what you're asking: <a href="http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-city-and-state-from-zip-code/" rel="nofollow">http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-cit...</a><p>Good luck
That's silly, many users expect that. What you <i>can</i> do is geolocate their country so they don't have to select their country but other than that I still ask them to type in their city and state...
PS: Here's the original blog that was the source of the apple image: <a href="http://www.lukew.com/ff/entry.asp?968" rel="nofollow">http://www.lukew.com/ff/entry.asp?968</a>