Forums

Branching in Mutipage

skillfulken 11 Apr, 2014
Hello!

I have made a multipage Joomla registration form and it works great! Thanks for your good product!

Now I want to branch the form into two streams, e.g.

Page 1 --> Page 2 --> Page 3 --> Page 4 (submit)
Page 1 --> Page 2 --> Page 5 --> Page 6 (submit)

How can I do it?
Max_admin 11 Apr, 2014
Hi Ken,

The easiest way to do this would be using a branching event (page).

So, according to your scenario, you will build the multi page form as normal, but page 2 will not submit to neither page 3 nor page 5, it will instead submit to page say 2.1, at this page you will have an "event switcher" action, with 2 events, "page3" and "page5", you will write your code there to trigger the desired event, and both events will have "event loop" actions pointing to the next page.

We have a tutorial on the "Event switcher" in the FAQs section!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
skillfulken 11 Apr, 2014
Hi Max

I will try it, thanks for your helpπŸ™‚

Best regards,

Ken
skillfulken 18 Apr, 2014
Hi Max,

I have searched through the FAQs section for the 'Event Switcher' and studied the following articles:

http://www.chronoengine.com/faqs/70-cfv5/5212-event-switcher.html
http://www.chronoengine.com/forums/posts/f3/t95582/event-switcher-in-chronoforms-v5-not-working-possible-js-error.html?hilit=event+switcher
http://www.chronoengine.com/forums/posts/f5/t95422/event-switcher-for-2-submit-buttons.html?hilit=event+switcher

Nevertheless, I still not understand how to 'write your code there to trrigger the desired event', could you please provide some examples?

Thanks!
Ken
Max_admin 18 Apr, 2014
Hi Ken,

You have 2 branches, page 2 then 3 OR page 2 then 5, so what makes this decision ? you will need to translate this into PHP code and use it in the event switcher.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
skillfulken 18 Apr, 2014
Hi Max,

I am making a Joomla Registration Form which directs new members into two target pages in order to register as two different user groups. It seems to be easier if I create two separate forms for those two different user groups. But I want the registration process to be more user friendly and so I have decided to merge them into one form.

Could you give me some sample codes on pointing to the next page? I barely understand programming, sorry for any inconvenience caused.
Max_admin 19 Apr, 2014
No problems, but that description doesn't answer the question of "how do you make the branching decision" ? how do you decide the target page ? based on what criteria ?πŸ™‚

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
skillfulken 19 Apr, 2014
I have attached a picture which illustrates the structure of the registration form. When a user presses button A, he will be registered as user group 1. When another user thinks that he belongs to user group 2, he should press button B. Is it clear enough? Thank you MaxπŸ™‚
Max_admin 19 Apr, 2014
That's so easy to do then, you will need to use a code like the one below in the "event switcher", but first, set the events to "a,b", then click "Load events":
<?php
if(isset($form->data["button_a_name"])){
return "a";
}else{
return "b";
}


You will need to update the button's name in the code!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
skillfulken 01 May, 2014
Updated: The problem is solved, thanks Max. Here are some captured screens which may be useful for other members to adapt a branching form.

Flow: Page1 (ref. page1.jpg) --> Page2 (invisible because it is used to run code) --> Page3 or Page4

1a. Create Page1 at 'Designer' Tab and make two buttons. (ref. page1-designer-a.jpg & page1-designer-b.jpg & page1-designer-c.jpg)

1b. Under the 'Setup' Tab, create an HTML (Render Form), mine is under the 'On Load' event because the branching is taking place at the first page of my form. (ref. page1-setup-a.jpg & page1-setup-b.jpg)

2.a. Create a transiting page under 'Designer' Tab which is used for switching. Mine is named as 'Page2'. (ref. page2-designer-a.jpg & page2-designer-b.jpg)

2.b. Create a new event under 'Setup' Tab which is used for loading the switcher. Remember to press 'load event' button. (page2-setup-a.jpg & page2-setup-b.jpg & page2-setup-c.jpg & page2-setup-d.jpg)

3. Finally, create Page3 and Page4 and there should be nothing special, just remember to use consistent Label which match the above procedures.

Max, please correct me if there is anything wrong.
Max_admin 05 May, 2014
Looks good, thanks for posting all info!πŸ™‚

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.