I need to create a form that routes someone to the next page according to the zip code they input.
Is there an easy way to set something like this up?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 26, 2010, 8:51 PM EDT
Create a form put a textbox on it. Drop a button also name "Take me there"
OnClick event of this button.. you can check the value of ZipCode and compare it with your criteria of redirection.
like:
if(txtZipCode.Text=="248001")
Response.Redirect("~\Dehradun.aspx");
and you are done.
Please mark as answer if it helps.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 26, 2010, 10:01 PM EDT
When you say "according to the zip code" I assume that the zip codes are put into regions or some other geographic category. Is there a database table that determines what the region is for each zip code? How can you determine what page to use, based on zip code? Your management has to decide how to do that.
Jim5 reputationPosted Mar 27, 2010, 1:34 PM EDT
Here's the details (not too bad, I don't think!)
I have 400 zip codes.
When someone enters a zip code into the box and clicks send - they will be taken to one of four pages (depending upon their zip code).
400 zip codes - all going to either - page1.htm, page2.htm, page3.html or page4.htm
Sam HobbsRank #107 · 20.5K reputationPosted Mar 29, 2010, 12:10 AM EDT
I am not sure of the details of ASP, but it seems to me that you should be able to send the zip code back to the server and let it do the look-up of zip code and navigation to the appropriate form. Probably the only problem with Amit's suggestion is that you need a table of some type to do a look-up of zip code.
Jim5 reputationPosted Mar 29, 2010, 5:56 AM EDT
Does anyone know what the script would look like?
Thanks for your help.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 29, 2010, 1:20 PM EDT