Free web development scripts for the webmasterDevelopment Scripts

 Site Navigation
 o Development Scripts
 o Text Only Edition
 o PHP.net News
 o Tutorials
 o Register an account
 o New entries this week
 o Affiliates/Links
 o Contact Us
 o About us
 o Advanced Search

 Browse Path
 o 2 users online
 o Most users online: 67
 o Home
  o ASP
   o Redirection/Links
    o Script

 Member Login
User Name
Password

 Standards
Valid XHTML 1.0!
Valid 
CSS!

 Recommended Links
 o PHP Freaks
 o Designer Baby Clothes
 o Advertise Here Make Money
 o Open Source Design
 o OxyScripts
 o devnet
 o designplace
 o Free Wedding Websites
 o Wedding Vendor Directory

Radio choice redirect (Rated 4)

Description:

You can use this simple ASP snippet to redirect a visitor to another page depending on what choice they make with a radio button

Code starts here


<% @Language="VBScript"%>
<%
Option Explicit
%>
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->

<%
' coded by Utopia
' http://www.designplace.org/

' a sub that redirects based on radio choice
Sub redirectMe()

' declare a variable for the choice
dim strChoice
' give the variable the value of the choice
strChoice = Request.Form("choice")

' if strChoice isnt empty
if strChoice <> "" then

' start a select case statement to decide where we redirect to
select case strChoice
case "1"
response.redirect "http://www.designplace.org/index.php"
case "2"
response.redirect "http://www.designplace.org/scripts.php"
case "3"
response.redirect "http://www.designplace.org/forum/"
case else
response.write "something else was chosen..."
end select

end if

End Sub
%>

<html>
<head>
<title>Utopia is my hero</title>
</head>

<body>
<form method="post">
1.) <input type="radio" name="choice" value="1" />
2.) <input type="radio" name="choice" value="2" />
3.) <input type="radio" name="choice" value="3" />
<input type="submit" value="submit" />
</form>
<%
' call our sub
call redirectMe()
%>
</body>
</html>


Submitted by Devscripts on 23-02-2003 22:44


Rate This Script

User Contributed Comments

Registered Members login
© Copyright 2003 - Devscripts.net