faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

13 of 15 people (87%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How do I direct users to different pages based on items in a drop down box on a web page?

Jul 3rd, 2002 15:47
Dave Morrison,


Your submit page should have somthing like this somewhere in it:
<FORM name="Redirect" action="redir.asp" method="get">
<SELECT name="url"> 
	<OPTION value="page1">faqts</OPTION>
	<OPTION value="page2">slashdot</OPTION>  
	<OPTION value="page3">asp index</OPTION>  
	<OPTION value="page4">webmonkey</OPTION>  
</SELECT>
<input type="submit">
</FORM>  
The following redirect script (redir.asp) will run on the on the 
server, invisible to the client:
<SCRIPT LANGUAGE="VBSCRIPT" RUNAT="SERVER"> 
goThere = Request.QueryString("url")
Select Case goThere
Case "page1"
	Response.Redirect "http://faqts.com"
Case "page2"
	Response.Redirect "http://slashdot.com"
Case "page3"
	Response.Redirect "http://aspin.com"
Case "page4"
	Response.Redirect "http://webmonkey.com"	
End Select
</SCRIPT>



© 1999-2004 Synop Pty Ltd