Conditional 'next' forms

D

David Beahan

I want to collect data from end-users by having them complete a series of
forms. I am OK with creating the forms and linking to an SQL database to
store results.
Problem is on form 1 they answer question 'Married or Single'. If married
when 'next' is clicked I want form 2 to open. If single I want form 3 to
open.
Ideally I will have a list of conditionals that will be read when next is
clicked from any page. If answer 1 is true and field 25 is blank then open
page 7. If answer 1 is false then open page 16 etc.
What ways can I achieve this result.
This is my first foray into Frontpage but I have extensive programming (not
VB) and database experience.
thanks,
 
S

Stefan B Rusynko

In your form action page (after processing the data) check for the answer and redirect to the appropriate page

If your field is form1 is a dropdown named say "MaritalStatus" with values set of "Married" or "Single" it would be:

<%
IF Request.Form("MaritalStatus" ) = "Married" THEN
response.redirect "form2page.asp"
ELSE
response.redirect "form3page.asp"
END IF
%>



|I want to collect data from end-users by having them complete a series of
| forms. I am OK with creating the forms and linking to an SQL database to
| store results.
| Problem is on form 1 they answer question 'Married or Single'. If married
| when 'next' is clicked I want form 2 to open. If single I want form 3 to
| open.
| Ideally I will have a list of conditionals that will be read when next is
| clicked from any page. If answer 1 is true and field 25 is blank then open
| page 7. If answer 1 is false then open page 16 etc.
| What ways can I achieve this result.
| This is my first foray into Frontpage but I have extensive programming (not
| VB) and database experience.
| thanks,
 
S

Sharon Gano

What would the code look like if we wanted to redirect based on whether or
not the field was empty?

Would it be:
<%
IF Request.Form("MaritalStatus" ) = "null" THEN
response.redirect "form2page.asp"
ELSE
response.redirect "form3page.asp"
END IF
%>
--
Thanks!
 
T

Thomas A. Rowe

<%
IF Len(Request.Form("MaritalStatus" ) ) > 0 THEN
response.redirect "form3page.asp"
ELSE
response.redirect "form2page.asp"
END IF
%>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
S

Stefan B Rusynko

See Thomas' response
null is not the same as empty

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| What would the code look like if we wanted to redirect based on whether or
| not the field was empty?
|
| Would it be:
|
| >
| > <%
| > IF Request.Form("MaritalStatus" ) = "null" THEN
| > response.redirect "form2page.asp"
| > ELSE
| > response.redirect "form3page.asp"
| > END IF
| > %>
| > --
| Thanks!
|
| "Stefan B Rusynko" wrote:
|
| > In your form action page (after processing the data) check for the answer and redirect to the appropriate page
| >
| > If your field is form1 is a dropdown named say "MaritalStatus" with values set of "Married" or "Single" it would be:
| >
| > <%
| > IF Request.Form("MaritalStatus" ) = "Married" THEN
| > response.redirect "form2page.asp"
| > ELSE
| > response.redirect "form3page.asp"
| > END IF
| > %>
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > |I want to collect data from end-users by having them complete a series of
| > | forms. I am OK with creating the forms and linking to an SQL database to
| > | store results.
| > | Problem is on form 1 they answer question 'Married or Single'. If married
| > | when 'next' is clicked I want form 2 to open. If single I want form 3 to
| > | open.
| > | Ideally I will have a list of conditionals that will be read when next is
| > | clicked from any page. If answer 1 is true and field 25 is blank then open
| > | page 7. If answer 1 is false then open page 16 etc.
| > | What ways can I achieve this result.
| > | This is my first foray into Frontpage but I have extensive programming (not
| > | VB) and database experience.
| > | thanks,
| >
| >
| >
 

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