Update city field based on zip field
I have sql 2k and created a asp page for a user to enter in new client info (name, address, phone, etc). I have a sql table called tblZip that has zipcode and the corresponding city and state.
If a user enters a zip code, I want the corresponding city and state to be displayed. I have heard of codes going to a new page or refreshing a page with the results. I want to be able to keep any existing data the user already has entered and allow them to finish the form. Plus I want the user to be able to change the zip if needed before saving the info.
Does anyone have a sample code for this?
Plus, I assume I should only store the zip info...and just display the city and state. Do I really need to store the city and state in their own fields in the table?
Thanks!
Ngan
|