Switch to full style
ASP/ASP.net examples
Post a reply

redirect page based on user selection radio button

Tue Apr 05, 2011 9:58 pm

redirect page based on user selection radio button , the user selection sent as parameter to the page and based on its value a switch redirect to right page .
Code:
<!--
 
Note it take the action the script name.
-->
<
form action "<%= Request.ServerVariables("SCRIPT_NAME")%>"  >
  <
input type "radio" name "selectParam" value "redirect1" checked="checked">
    
Visit Home Page<br>
      <
input type "radio" name "selectParam" value "redirect2">
        
Visit Forums<br>
          <
input type "radio" name "selectParam" value "redirect3">
            
Visit Contact Us.<br>
              <
input type "submit" value "Visit"
</
form>
<% 
'get the parameter sent.
strSelectedPage = Request.Form("selectParam") 
'
depending on the users selection redirect to that page 
Select 
Case lcase(strSelectedPage
Case 
"redirect1" 
Response.Redirect "index.php" 
Case "redirect2" 
Response.Redirect "forums.php" 
Case "redirect3" 
Response.Redirect "contactUs.php" 
End Select 
%> 




Post a reply
  Related Posts  to : redirect page based on user selection radio button
 Radio Button list validation ASP     -  
 redirect to another page     -  
 How can i redirect to a one servlet from a two jsp page?     -  
 Redirect to a New Page javascript code     -  
 Convert link and button to custom button with good style     -  
 JSF Radio Buttons Form     -  
 Image Scroller-scrollbar-LINE_UP,LINE_DOWN-PAGE-UP-PAGE-DOWN     -  
 Redirect to a URL     -  
 How do you 301 redirect a dynamic URL?     -  
 redirect after countdown     -  

Topic Tags

ASP Forms