Multi-Step Form w/ Conditional Second Step

chronoob 04 May, 2011
Hi,

I would like to create a chronoform that has a conditional second step. For instance, in step 1, I plan to have a Select input that says, "number of additional guests". If the user selects "0" for number of additional guests, then the form should just perform a final submit to the database, but if the user chooses 1 or more additional guests, then I want to display a second step that will display text inputs for the names of the additional guests.

Thanks,

chronoob
GreyHead 07 May, 2011
Hi chronoob,

The multi-page plug-in doesn't support conditional steps. You have to go through all of them. That said, I guess that you could have a step that just shows a message and 'Click to continue' if there are no inputs to complete. You'd do this with conditional code in the Form HTML.

Bob
chronoob 09 May, 2011
Bob,

Could you display a conditional "Thank You" page on the second step and then initiate the form save action via PHP code?

As an aside, the icons for turning on and off plugins appear to be backwards in my install, a checkmark indicates disabled, and an x indicates enabled. Is that normal?

chronoob
GreyHead 09 May, 2011
Hi chronoob,

You can probably do an auto submit with JavaScript in the page.

The icons in the current version show a red bar with an 'x' icon for disabled and a green bar with a 'check' icon for enabled.

Bob
chronoob 09 May, 2011
What I was thinking was more along the lines of using the a variant of the Autogenerated code to submit the form directly to the db behind the scenes if the condition was fulfilled. No need for javascript in my scenario. The only problem is that if somebody backs up the form, it's already been submitted.
GreyHead 09 May, 2011
Hi chronoob,

It's simpler to run a check in the Server Side validation box and relaod the form if there is an error.

You might find some help with a Ajax/JavaScript solution from this article from The ChronoForms Book.

Bob
This topic is locked and no more replies can be posted.