Redirect to page, based on answer

D

Dianne

I know how to collect data using FP forms and Access.
I know how to collect data and pass it to another ASP.

I want to collect data on Page1.asp; when Submit is pressed, the user is
taken to Page2.asp where s/he is asked a Yes/No question using option buttons.
If user clicks Yes, s/he is directed to Yes.asp, otherwise No.asp.
Data collection continues from there.
I don't need to save the Yes/No answer.

TIA,
Dianne
 
M

Mike Mueller

Page 1 will contain a form and will be submitted to a custom
script called page 2.asp

Page2.asp will collect the information from page1, and then
you also will have your second form. The second form will
use hidden fields populated with the form results from
page1. Page2 will also submit the information to a custom
script, called process.asp

Process.asp will read the form information from page2 will
read the form data. Except for the yes/no, the information
will be stored in session variables. The yes/no will be read
and an if/.then statement will redirect to yes.asp or no.asp

yes.asp and no.asp will read the session variables back in
and then you will collect more data. The info from the
session variables will be used to populate hidden fields
here as well. Continue on as needed

Mike



:I know how to collect data using FP forms and Access.
: I know how to collect data and pass it to another ASP.
:
: I want to collect data on Page1.asp; when Submit is
pressed, the user is
: taken to Page2.asp where s/he is asked a Yes/No question
using option buttons.
: If user clicks Yes, s/he is directed to Yes.asp,
otherwise No.asp.
: Data collection continues from there.
: I don't need to save the Yes/No answer.
:
: TIA,
: Dianne
 
D

Dianne

Thanks -- this paragraph is giving me trouble:
Process.asp will read the form information from page2 will
read the form data. (Not a complete sentence - I'm not criticizing your grammar, but it's not clear to me.)
Except for the yes/no, the information
will be stored in session variables. The yes/no will be read
and an if/.then statement will redirect to yes.asp or no.asp (I know the idea of if/then statements, but don't know how to write them exactly.)

I think I can figure out the rest.

TIA,
Dianne
 
P

p c

in page process.asp using pseudo code for ASP code
<%
grab form feilds from the posted form.

assign fields you want to retrieve later to cookoies or session variables.

yespage="someyespage.html"
nopage="somenopage.html"

If yesnofied; - "yes" then
Response.redirect(yespage)
Else
Response.redirect(nopage)
End if

%>

...PC
 
D

Dianne

The IF/THEN is almost working. This is Page2.asp:

<html>

<form method="POST" action="Process.asp">
<p><input type=â€text†name=â€Named†size=â€20â€
value=â€<%=Request.Form("Name")%>†> Name</p>
<p><input type=â€text†name="YesNo" size=â€20â€
value=â€<%=Request.Form("R1")%>†> Yes/No</p>

<%
Dim yespage
Dim nopage
yespage = "http://microsoft.com"
nopage = "http://yahoo.com"

If request.form("Name") = "mama" then

'If request.form("R1") = "yes" then *** This is the part that won't work ***
response.redirect(yespage)
else
response.redirect(nopage)
end if

%></html>

If I type MAMA in the text box of Page1.asp, it directs me to the YesPage.
But if I try to use the option buttons, it always goes to the NoPage. On
Page1.asp, I changed the Initial Values of the option buttons to Yes and No
(from V1 and V2).

I'm wondering if there is something about option buttons that's preventing
it from working?

Thanks for your help.
Dianne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top