Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Radio buttons to select which ASP page to go to

Posted on 2002-05-08
7
Medium Priority
?
186 Views
Last Modified: 2010-04-07
Hi,
I have a HTM page that I have placed two radio buttons, a text box and a submit button onto.One of the radio buttons has a value of xxx the other a value of yyy.I want to set it up so that if I select radio button with yyy then press the submit button it goes to a certain asp page e.g. "1.asp" and passes the text I have put into the text box but if radio button xxx is selected when the submit button is pressed it goes to a different asp page e.g "2.asp" and still passes the text from the text box.

I can get it to submit the text info to one of the asp pages by putting the name of the page in the action field of the form post but cant see how to get it to change?
I am using dream weaver 4
ANy help or suggestions would be much appreciated
0
Comment
Question by:monitorwa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 17

Expert Comment

by:dorward
ID: 6996686
Combine the functions of the two ASP pages in to a single page by wapping them in a big if statement.

I don't know ASP but this PHP example should give you an idea as to how to implement it:

if ($myRadio == 1) {
    do_this();
    do_that();
    do_the_other();
} else {
    do_somthing_else();
    do_another_thing();
    think_of_more_boring_function_names();
}
0
 
LVL 1

Expert Comment

by:raid999
ID: 6998669
you can try this it works for me:

<form action="choosepage.asp" method="post">
<input type="radio" name="PageChoice" Value="Page1"> Page 1<BR>
<input type="radio" name="PageChoice" value="Page2"> Page 2<BR>
name<input type="text" name="name">
<input type="submit" value="Choose Page">&nbsp;&nbsp;<input type="reset"></form>

ChoosePage.asp

<%
  Option Explicite
  Dim strChoice
  Dim strName

  strChoice= Request.Form("PageChoice")
  strName= Request.Form("name")

  if strChoice= "Page1" then
     Response.Redirect "page1.asp?name="+strName
  Else
     Response.Redirect "page2.asp?name="+strName
  End if
%>
0
 
LVL 1

Expert Comment

by:raid999
ID: 6998675
Sorry in the last part you should use & not + sorry again
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 
LVL 1

Expert Comment

by:raid999
ID: 6998686
Sorry in the last part you should use & not + sorry again
0
 
LVL 1

Accepted Solution

by:
zeheb earned 300 total points
ID: 7036676
This should also work.
I check it in my machine and it work.

<HTML>
<HEAD>
   <SCRIPT LANGUAGE=javascript>
         function SelectPage()
         {
             if (document.YourForm.Radio(0).checked)
                 document.YourForm.action = "1.asp"
             else    
                 if (document.YourForm.Radio(1).checked)
                     document.YourForm.action = "2.asp"
         }
   </SCRIPT>
</HEAD>
<BODY>
    <FORM NAME="YourForm" METHOD="GET" OnSubmit="JavaScript:SelectPage()">
        <INPUT NAME="Radio" TYPE="radio" VALUE="xxx"> <BR>
        <INPUT NAME="Radio" TYPE="radio" VALUE="yyy"> <BR>
        <INPUT NAME="TextBox" TYPE="text"> <BR>
        <INPUT TYPE="submit">
    </FORM>
</BODY>
</HTML>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8148400
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 

Author Comment

by:monitorwa
ID: 8149011
Sorry guys - for some reason I hadnt been notified of any comments until just now? I actually figured it out a while ago but am happy to award the points as I have. As we all would have noticed what was Experts Exchange isnt anymore!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question