Forums

Event Switcher 2 actions

diego.matos 27 Jun, 2014
Hi.
I'm trying to do the some as Clovis but I don't know to do.
I have 2 radion button and I want 2 differents e-mail in each one. I'm using the ChronoForms5.
I mounted this structure in the setup:
On load: show form
On Submit: email1, email2, display message and event switcher. Put in the event switcher the same Clovis code, but I know how do this differents actions to each radio button. I don't receive any e-mail.

Diego
diego.matos 27 Jun, 2014
Hello, Calculus00
Thanks for the help, but still does not solve my problem.
diego.matos 27 Jun, 2014
Answer
Problem solve.
My mistake was in my if inside of the event switcher.

<?php
if($form->data["radio_button"] == "variavel"){
return "success";
}else{
return "fail";
}

thanks
gmonasterio 19 Aug, 2014
Diego

I am having the same problem, but could not manage to solve it
I created an Event Switch, where the user choose between two payment methods: Online and Offline. Depending on the button he/she chooses, it redirects to an article in Joomla site.

radio button ID is named pagamento. The options 0=Online, 1=Offline
Below is the code for the Event SwitchI adapted from Diego. (I do not know how anything about php, just copied the code)

<?php
if($form->data['pagamento'] == 'Online'){
return 'Online';
}else{
return 'Offline';
}
?>

The structure of the form is in the attachment: [attachment=0]printscreen.png[/attachment]

What am I doing wrong? The brackets on the code maybe??

Thanks in advance.

Max_admin 19 Aug, 2014
No, you should use the correct values, so you should use 0 or "0" because this is value of the dropdown option:
if($form->data['pagamento'] == 0){


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gmonasterio 19 Aug, 2014
Thanks Max for the prompt response.

I have modified the code of the Event Switch as you suggested:
<?php
if($form->data['pagamento'] == 1){
return "Online";
}else{
return "Offline";
}
?>


Now it works for 1=Online, but when the 0=Offline radio button is marked, it jumps to the e-mail and message events, skiping the Offline Redirect.

Any hint?
Max_admin 20 Aug, 2014
There is no reason for this to happen, please double check that the redirect action in the "offline" event is configured correctly ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
gmonasterio 20 Aug, 2014
I have redone the Redirect and it worked fine.

Thanks Max for your helpful hints!

Best Regards
dariegler 19 Jan, 2015
i am trying something similar with no success. i cannot get the on offline and on online events inside of on submit, i want to run paypal redirect if online is selected. any ideas? :?
GreyHead 19 Jan, 2015
Hi dariegler,

How do you have the Event Switcher set up?

Bob
GreyHead 19 Jan, 2015
Hi dariegler,

How do you have the Event Switcher set up?

Bob
dariegler 19 Jan, 2015
i have a yes no choice(checkbox group) in the design and then in the on submit, i have event switcher and i am checking the value of the payment variable and setting to true if Paypal and false if not. i t appears to ignore the event check.
Max_admin 19 Jan, 2015
Please try a "Radio" button group and post your code if it doesn't work!

If possible please post your radio boxes options too!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dariegler 19 Jan, 2015
the radio worked, but if i cancel the paypal transaction it does not return to the site. It returns a blank page. i have the url of the site in the return field.

http://www.owrc.net/index.php?option=com_chronoforms5&chronoform=febreservation
GreyHead 20 Jan, 2015
Hi dariegler,

PayPal uses a Cancel URL for cancellations. I think that you can add that in the Extra Params box on the Advanced tab of the action. Something like:
cancel_return=http://www.owrc.net/index.php?option=com_chronoforms5&chronoform=febreservation&event-pp_cancel
or:
cancel_return=http://www.owrc.net/index.php?option=com_chronoforms5&chronoform=febreservation&event-pp_return&status=cancel

Bob
dariegler 20 Jan, 2015
neither one worked.
dave
GreyHead 21 Jan, 2015
Hi dariegler,

How do you know exactly? What happens when you cancel?

Bob
dariegler 21 Jan, 2015
i just get a blank screen. this is what is in the url at the return

https://www.paypal.com/us/cgi-bin/merchantpaymentweb?dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0224adecfb0124e9b61f737ba21b08198d8562aa8a3da7ac30bbfba73b3e80dcc

what else can i give you?
Max_admin 21 Jan, 2015
Did you try the "return url" setting in the PayPal action ? I think the parameter name is "return_url".
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.