Click to See Complete Forum and Search --> : Directing the Submit Button on Form


manita
07-03-2003, 11:37 AM
I am setting up a pre-qualifying form that have 13 questions. The questions are "Yes" or "NO" (radio Buttons) answers but I have 4 questions that are the questions that need to direct the Submit button to either "accept" or "decline". I'm working in Dreamweaver4 and I'm not able to figure out how to do this. These "yes" or "no'" answers are set up as radio buttons, and I'm stumped. HELP !!!! PLEASE!!! Is there a script out there --anywhere -- that will help! Java, ASP, HTML, etc. ANYTHING!!!!

:confused: :confused: :confused:

Ribeyed
07-03-2003, 01:21 PM
hi,

you can do this with an if statement.

<%
if submit = "Accept" then
response.redirect "acceptapge.asp"
else
response.redirect "declinepage.asp"
end if
%>

hope this helps

manita
07-03-2003, 04:32 PM
Thank you So much. I try this and let you know if this works.:D

manita
07-07-2003, 01:21 PM
Hi Again [SWR]Ribeyed

Please forgive me but I'm new at this and I'm still unable to have the submit button be directed to "accept or decline" page where necessary. Here is the information. The numbers 1. Answer "No" should be directed to "decline page".
5. Answer "No" decline page. 6. Answer "Yes" decline page. Can you help me PLEASE -- I really stomped. :confused:

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
if submit = "Accept" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
%>
<body>
<form action="" method="get">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">1. Are You Divorced:
<input type="radio" name="divorced" value="radiobutton">
Yes
<input type="radio" name="divorced" value="no">
No <br>
If Yes What Year:
<input type="text" name="Year1">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">2. Are You Widowed:
<input type="radio" name="widowed" value="radiobutton">
Yes
<input type="radio" name="widowed" value="radiobutton">
No <br>
If Yes What Year:
<input type="text" name="years2">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">3. Are You Separated:
<input type="radio" name="separated" value="radiobutton">
Yes
<input type="radio" name="separated" value="radiobutton">
No <br>
If Yes What Year:
<input type="text" name="years3">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">4. Do You Have
Children:
<input type="radio" name="children" value="radiobutton">
Yes
<input type="radio" name="children" value="radiobutton">
No <br>
If Yes How Many:
<input type="text" name="children">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 5. Are You Celibate:
<input type="radio" name="celibate" value="radiobutton">
Yes
<input type="radio" name="celibate" value="radiobutton">
No</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">6. Do You Believe
in Premarital Sex:
<input type="radio" name="RQquestion2" value="radiobutton">
Yes
<input type="radio" name="RQquestion2" value="radiobutton">
No</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type="submit" name="Submit" value="Submit">
<input name="reset" type="reset" id="reset" value="Reset">
</font></p>
</form>
</body>
</html>

manita
07-08-2003, 09:55 AM
Hi Dave:

I've tried this but I'm confused! The form action -- what does it link to ??? I can't tell it to link to the "declinepage" or the "acceptpage" because the answers still only answer to one form action. What am I doing wrong??? This is really giving me a headache and I've got to get the solved by Wednesday. Any help ???!!!:confused: Still!

<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>pretest</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
if Request.QueryString("Divorced") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
if Request.QueryString("Widowed") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
if Request.QueryString("Separated") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
if Request.QueryString("Children") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
if Request.QueryString("Celibate") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
if Request.QueryString("Presex") = "Yes" then
response.redirect "acceptpage.asp"
else
response.redirect "declinepage.asp"
end if
%>
<body>
<form action="declinepage.asp" enctype="multipart/form-data" method="post">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">1. Are You Divorced:
<input type="radio" name="divorced" value="Yes">
Yes
<input type="radio" name="divorced" value="No">
No <br>
If Yes What Year:
<input type="text" name="Year1">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">2. Are You Widowed:
<input type="radio" name="widowed" value="Yes">
Yes
<input type="radio" name="widowed" value="No">
No <br>
If Yes What Year:
<input type="text" name="years2">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">3. Are You Separated:
<input type="radio" name="separated" value="Yes">
Yes
<input type="radio" name="separated" value="No">
No <br>
If Yes What Year:
<input type="text" name="years3">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">4. Do You Have
Children:
<input type="radio" name="children" value="Yes">
Yes
<input type="radio" name="children" value="No">
No <br>
If Yes How Many:
<input type="text" name="children">
</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 5. Are You Celibate:
<input type="radio" name="celibate" value="Yes">
Yes
<input type="radio" name="celibate" value="No">
No</font></p>
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2">6. Do You Believe
in Premarital Sex:
<input type="radio" name="Presex" value="Yes">
Yes
<input type="radio" name="Presex" value="No">
No</font></p>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<input type="submit" name="Submit" value="Submit">
<input name="reset" type="reset" id="reset" value="Reset">
</font></p>
</form>
</body>
</html>