Ask HN: Address Form With No City State (just Zip Code)
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
[ 0.24 ms ] story [ 37.3 ms ] threadWhy? I am sick to death of typing my name and address in stupid forms that aren't tagged properly for my browser to fill them in. Zipcode I can live with, and is not that big a deal to look up.
What annoys me even more is on some form where I am typing in my full address and it can't even work out what my zipcode is. How about doing a little validation, and taking the opportunity to impress the client during the otherwise-tedious signup process?
Sad thing is, it isn't the providers that can't adopt it - the technology exists; it's the users. Users are locked into a model that is out-dated and are also locked into their own laziness and ignorance (many users would be scared off by the very mention of "FOAF" let alone maintaining their "own" FOAF file).
But, here are some of my counter arguments to your comment:
A) some users (I'm one of them) don't always use my actual IP to register on a site, I use anonymizing services often so I usually get frustrated by geolocating/ajax auto-fill forms and give up on a site that doesn't do any sort of graceful fallback
B) AJAX isn't effective when your user can't use Javascript (have you tried using your site with a screen reader? Can blind people use your site with ease?)
C) The act of typing in your address really is not that painful - I specifically set my forms with the autocomplete="off" attribute so user's personal data isn't being stored by their browser in the name of "convenience" (particularly billing forms that ask for your address data and cc data)
As for the AJAX / javascript disabled issue: just because it's possible to use AJAX in a way that locks out some users, doesn't mean it's necessary. There are definitely techniques for unobtrusive javascript that fails gracefully, and that's exactly how I'd like to implement this.
a) I'm not asking you to work out my address/zip from my IP.
b) If I had javascript disabled then that would be a problem, but since I don't then I'm OK with you putting things inside the script tag.
c) How do you know what's painful for me? You're not my parents, and I didn't ask you to protect me from my own browser settings. I especially don't appreciate it when features that I spent time configuring (like autocomplete) fail to work because you think you know what is good for me.
And here is the link directly for what you're asking: http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-cit...
Good luck