

Ask HN: Address Form With No City State (just Zip Code) - Johngibb

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?
======
matdwyer
Here is a great post that was posted on here:
[http://uxmovement.com/forms/innovative-techniques-to-
simplif...](http://uxmovement.com/forms/innovative-techniques-to-simplify-
sign-ups-and-logins)

And here is the link directly for what you're asking:
[http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-
cit...](http://forumsblogswikis.com/2007/08/15/using-ajax-to-get-city-and-
state-from-zip-code/)

Good luck

------
Ixiaus
That's silly, many users expect that. What you _can_ 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...

~~~
anigbrowl
_I still ask them to type in their city and state..._

Why? 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?

~~~
Ixiaus
I think the larger issue that is bugging you is the fact that user's data on
the web is no longer owned/exchanged by the user but by the properties that
the user interacts with. It frustrates me too, believe me. I would much rather
visit a site that asks me for my FOAF (contains relationships to friends,
profile data, &c...) URI, and a cert to authenticate me (this is called
FOAF+SSL) - then automatically load and cache (for say, a month?) my FOAF
profile data. Thereby never requiring me to enter anything more than once
_except_ for my FOAF URI path.

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)

~~~
Johngibb
I'm not following your arguments. If a zip code can 95% of the time uniquely
identify a city and state, why make them type it in? Sure it's not "THAT"
painful, but neither are a lot of small things that add up to making a big
difference.

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.

------
Johngibb
PS: Here's the original blog that was the source of the apple image:
<http://www.lukew.com/ff/entry.asp?968>

------
Johngibb
Please see <http://gibb-test-address.heroku.com/> for my attempt at solving
this.

