Page branching depending on input (like wufoo)?

benjaminalbrechtcom 15 Nov, 2023
Hi there,

how can I make my multi-page form branch to / skip pages, depending on user input?

Example: page one asks for a person's name and age, and then if a 2. person's data is to be entered.
If yes, I want to show form page 2 incl. optional, and mandatory fields.
if no, I want to skip page 2, and advance to the final page.

Thanks, any heads up greatly appreciated!
Ben
Max_admin 15 Nov, 2023
you can not do this but you can place both fields groups on a single page but in 2 different PHP action events

each event will match a condition
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
benjaminalbrechtcom 15 Nov, 2023
Max, thanks,

php isn't a problem for me, but
wouldn't reacting to user input require javascript instead of php?
Could you draft a tiny, quick and dirty example?

Thanks!
Max_admin 16 Nov, 2023
Answer
1 Likes
you need php to process form data after the 1st page has been submitted, javascript is for processing data before submit

the code can be something like this:

if($this->data("test") == "2"){
return "page2";
}else{
return "page3";
}


add 2 events to your PHP action, page2 and page3, then drag the fields you need in both of them

The PHP action should be in the 2nd page "load" section, that makes it process the data from page 1 and show the correct fields
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
benjaminalbrechtcom 20 Nov, 2023
1 Likes
thanks! I managed to get by with only event triggers and event listeners in this case.
You need to login to be able to post a reply.