Event Switcher

sahanashah84 10 Oct, 2013
Hi,

I have 2 Submit buttons on my chronoform with each having to perform a different action on submit. I read over the forums that I can achieve this by using the"Event Switcher". SO, I created 2 Events called Fav and Message.

Now, this is my php code in the Event Switcher.
<?php

if ($_POST['fav']) 
{
    return 'event_fav';
}
elseif($_POST['message']) 
{
   return 'event_message';
}
?>



However, When click the Fav button ,the Fav event is not being processed. Can you help me?
GreyHead 10 Oct, 2013
Hi sahanashah84,

From the action help tab:

To trigger an event the code block should return one of the four values: 'event_a', 'event_b', 'event_c' and event_d'.



Bob
sahanashah84 11 Oct, 2013
So, what should be the name of the Events? I am still not getting.

I have added the Event switcher in the "On Submit" with the php code mentioned which i changed -
<?php

if ($_POST['fav']) 
{
    return 'event_a';
}
elseif($_POST['message']) 
{
    return 'event_b';
}
?>


Then i created 2 Events see below. Please Tell what is wrong . I have attached a snapshot also.
sahanashah84 12 Oct, 2013
Hi,

Yes, i have Downloaded the Event Switcher and Loaded the folder Event_switcher_gh into the form_actions. But still same issue, when the click on the First Button, it loads a empty chornoform page rather than the functions under event a which is "Show Thanks Message".
GreyHead 13 Oct, 2013
Hi sahanashah84,

I don't see the Event Switcher [GH] in your form image.

You need to drag a copy from the [GH] Custom Actions group into the On Submit event of your form.

I'm not clear what the 'Custom Event Switcher' that you have used is, or is supposed to do??

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