Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional jump from form

Status
Not open for further replies.

MinalMoe

IS-IT--Management
Mar 25, 2004
62
GB

I'm using MX7, a page of which contains a form in which I want the action to take the user to Page_1 and then to Page_2 and so on if certain data needs to be filled in, or to take the user straight to Page_2, if the data doesn't need to be filled in.

If it's adults only, then go straight to Page_2.

If there are children, etc, then go to Page_1, fill in age details, and then move to Page_2.

So it would be something like

<cfif Children_No GT 0> action jumps to Page_1
<cfelse> action jumps to Page_2 </cfif>

How do I code the page to make that conditional jump.

Thanks for any help.
 
How about the following...

<cfif Children_No GT 0>
<cflocation url="page1.cfm">

<cfelse>
<cflocation url="page2.cfm>

</cfif>

 
I thought about OnClick or CFlocation, but the problem is that the Number of children is transmitted as a Hidden Input from the page before that. So how would that effect things then?
 
Did this thread not fix your problem? thread232-1379130


Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
What I found worked in the end was the following code:-

<cfset CF_Var = "Page_1.cfm">
<script type="text/javascript" language="JavaScript">
<cfoutput>
var #toScript(CF_Var, "Java_Var")#;
</cfoutput>
</script>

<form id="Form_Name" name="Form_Name" method="post">
<input type="submit" onclick="document.forms['Form_Name'].action = Java_Var" name="Submit" value="Submit" />
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top