Update city field based on zip field

N

Ngan

I have an asp page where a user can add a new client
info. The fields on the page are the typical name,
address, phone, etc.

I have a sql 2k db with a tblzip with fields zipcode,
city, state.

When the user enters in a zip in the zip field, I want
them to click on a button and it would get the
corresponding city and state from the table and
autopopulate the city/state field on the page. I don't
want to use an array or move to another page because I
want to keep the data in the other fields and the user
still needs to finish entering other info on the page.

Anyone have a sample of this? I have seen other codes
where it does move to another page, but I don't want that.

Ngan
 
S

Skydolphin

You could javascript to do it on the onblur event of the text field. It could quite complicated. You could use and xml file with cities based on the zip code and search through the xml in the javascript function to populate the next field. I don't have a sample off hand but could put something short together for you if you like. Email me if you do

Rhonda
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top