[thelist] U.S. Cities
David Kaufman
david at gigawatt.com
Fri Aug 12 08:11:55 CDT 2005
Anthony <apwebdesign at yahoo.com> wrote:
>
> Dena Marchant <dmarchand at verizon.net> wrote:
>
>> I'm wondering if there is a service that can take a
>> string that is the name of a [U.S.] city and tell you
>> whether it is valid?
>
>I personally would ask for zip code, and then lookup
> the city/state for the user, with a confirmation
> screen:
>
> http://www.usps.com/webtools/address.htm
I would, too. I'd even go so far as to make the form a two-page
process: 1. What is your zipcode? 2. Enter your street address on a
form now showing city, state and zip in read-only form, based on the zip
you entered.
Of course you need a database of every city in the country to do
this.... but you don't necessarily need to integrate with the U.S. post
office website in eral-time -- yick.
Here's a trivial example that uses AJAX and a CSV file of about 43,000
U.S. zipcodes to fill out the associated city and state as soon as they
enter the zipcode!
http://www.aprogrammersjournal.com/article.aspx?id=65
Pretty clever, those Ajaxians, eh?
-dave
More information about the thelist
mailing list