Forums

Redirect based on selection

jjspelman 28 Mar, 2017
Hey Fellas,

I was wondering if there is a way I can set a different redirect based on the selection of a drop down. We want to track submissions in Analytics.

For example if the Select item is Male or Female, redirect them to a page that says "Thank you, Sir", or "Thank you, Madam."

I know I can add a redirect in the SetUp area but I am not sure of how to set different destinations.

Hope you can help.

JJ
GreyHead 28 Mar, 2017
Hi jjseplman,

The simplest way is probably to use a Custom Code action for the Thank you message and add PHP to control the output depending on the form data.

You could also use Custom Code to do redirection to different URLs using the Joomla! $app methods.

Bob
Max_admin 30 Mar, 2017
Hi,

In v6 there is an "Event Switch" action, if you set the "data provider" to {data:dropdown_field_name} then you can place different redirect actions in the different events available.

Another advanced way, use the "Switch" action, same data provider, but then you will need to provide a list of value:output:

male:Thank you sir.
female:Thank you madam.

Then write {fn:switch_action_name} in a "Custom code" action.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 30 Mar, 2017
Thanks, Max, this looks promising. Especially for a non-programmer like myself.

I didn't know V6 was out. So I downloaded it and installed on the dev version of the site. But it installs next to V5 - so I have to recreate the forms?

or can I backup a V5 form then restore in V6?
jjspelman 30 Mar, 2017
Wow, V6 looks like a completely different component. I am kind of lost in there.

I see that I can import V5 but it will save only the design view. Which isn't really design view anymore.

Any tutorials for V6 yet?
Max_admin 31 Mar, 2017
Hi jjspelman,

No tutorials for v6 yet, but it works in the same way v5 works, in the design view you add the form elements and you can preview them too, but its divided in sections, sections are like pages, but they don't have to be used as pages, they are like v5 containers.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 31 Mar, 2017
Would either of you guys be willing to tell me exactly how to do this? Or if I gave you access set it up for me? I will buy both of you a couple pints or even buy another license?
Max_admin 31 Mar, 2017
Hi jjspelman,

In v6, drag a new "Event switcher" action under the "Setup" section, in the "data provider" please write {data:dropdown_field_name}, change the "events" to the values you expect to have from the dropdown, say male,female then click "update events", now drag a "Custom code" action in each event and write your message.

Please note that, if the dropdown did not pass a value then none of the events will run.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 31 Mar, 2017
Thanks, Max but I could not get this to work.

I assume you meant drag event switcher from the "Events" tab" The "Set Up" tab is V5?

Any how, I dragged the event switcher into the submit section. I then added the data provider info {data:field_dropdown2}, added the two events (comma separated) "renter,owner". (no quotes) I then hit the "update events list". This did change the A,B to the events I entered. But when I saved the form then went back to the form, my events were gone and replaced with the original A,B.

I really needed to redirect users based on the selection because the client is tracking those page landings in AdWords.

I was not able to drag anything into either of the two Events created. When I dragged it, it ended up below the entire event switcher "area". Am I missing something?
Max_admin 01 Apr, 2017
Hi jjspelman,

You found a bug! a patch will be needed to fix this at your end.

But you can do it with the altnernative way, use a "Switch" action instead, use the same data provider, but please note that you need to use this syntax {data:field_name}, the field name is shown inside a green label under the "Designer".

In the "Values setup" section of the "Switch" action, add the following:

renter:{redirect:an event name in your form}
owner:{redirect:an event name in your form}


You may also send me a message using the "Contact us" page to get the patch file.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 03 Apr, 2017
I am having difficulty getting this to work for me.

I created a Switch event, used data provider {data:dropdpwn2} (which is name in green), then added
renter:{redirect:renters-thank-you}
owner:{redirect:owners-thank-you}
inside the Values set up.

I added 2 redirects, added the correct URLs and named them according to the names in the Values setup.

But is it not working for me. Any help is greatly appreciated.

Also, when I receive the email submissions, the data is not being collected. I am getting, for examples: Your Name {data:name}, Email {data:email}

I am testing in the form manager. I tried adding this form to a page but it is not displaying. I am using the short code {chronoforms6}general_contact{/chronoforms6} but the shortcolde shows on the page and not the actual form.
😟
Max_admin 03 Apr, 2017
1 Likes
Hi JJ,

According to the code, you must have a form event named "renters-thank-you", is this the case ?

The other issues should be fixed by the next official update.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 03 Apr, 2017
I used the patch orV6. The redirect now works. Now just need to see about getting it live and returning the field data upon submission. Hopefully it's in the works to be published asap.🙂
Max_admin 04 Apr, 2017
HI JJ,

Hopefully the new update will be ready later today or tomorrow.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 04 Apr, 2017
That would be great!
jjspelman 05 Apr, 2017
Any word on this, Max? My client is getting rather frustrated that I haven't provided a solution yet.

I was thinking if there was a dynamic way to load a different form by clicking either renter or owner (without reloading the page) it would suffice for now but have no idea how.
Max_admin 06 Apr, 2017
Hi JJ,

But you have Google tracking code on the 2 pages, correct ? then its better to reload.

I will try to have this ready in the next few hours.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 06 Apr, 2017
There is tracking code on the two landing pages that the user is directed to - not on the forms page.
Max_admin 06 Apr, 2017
Ok, but why do you need to load a page when the dropdown value changes ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 06 Apr, 2017
I was only mentioning that if we were unable to create the redirect today. Worst case scenario.
Max_admin 06 Apr, 2017
But the redirect is already working with the last installer I sent earlier, no ?

I will try to have the official installer ready today!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 06 Apr, 2017
The latest update has been published on the downloads page!

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 06 Apr, 2017
Hi Max, I have downloaded the V6 plugin and installed it as well as the module and component.

I am getting an error saying the form doesn't exist. I am using the proper syntax (
{chronoforms6}general_contact{/chronoforms6}
) - but it doesn't want to work.

is this because I have V5 installed as well??

Also not able to access the plugin after installing. Please see error screen shot.

Any thoughts?
Max_admin 06 Apr, 2017
Answer
Hi JJ,

The errors are not related to v5

You had a typo in the form ALIAS used in the plugin short code, it should be "general-contact", once this was fixed, it worked.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
jjspelman 06 Apr, 2017
1 Likes
OK brilliant! Works like a charm now. Thanks a TON Max!!!!
jjspelman 27 Apr, 2017
1 Likes
Hey Max,

I added different email recipients based on the Event Switcher selection and it worked like a charm. Great stuff!!!
Max_admin 29 Apr, 2017
Great, glad you like it!🙂
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.