• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Conditional jump from form

Guest
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied


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.
TOPICS
Advanced techniques

Views

343

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied

You'd have to do it in the onClick etc events of a particular field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied

I thought about OnClick, 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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 12, 2007 Jul 12, 2007

Copy link to clipboard

Copied

LATEST
I don't agree with the onClick Concept. My suggestion is to always submit the form to page 1 and put all your if/else logic on the form that accepts that form.

If you are going to be moving your user directly to page 2, you will lose your form variables. You might want to copy them to the session scope first, depending on what page 2 actually does.

Another way is to submit your form to an action page, and use cfinclude for pages 1 and 2 instead of redirecting.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation