I can't get this to work as I expect so I'm looking for some help/advice.
I have a form. If I want to edit it I use &event=edit on the URL and with PHP then add the cf_id hidden field and another hidden field called 'event' with the value 'edit' in it. So far so good. However I want different actions depending on which event is active when you hit the submit button.
So On Submit I put an Event Switcher [GH] action (ordinary event switcher only has 2 states sucess or fail) with the following code.
For each state I can then put different email and thanks messages if it worked, but it just seems to ignore the states & code and do a default db save. Why?
I have a form. If I want to edit it I use &event=edit on the URL and with PHP then add the cf_id hidden field and another hidden field called 'event' with the value 'edit' in it. So far so good. However I want different actions depending on which event is active when you hit the submit button.
So On Submit I put an Event Switcher [GH] action (ordinary event switcher only has 2 states sucess or fail) with the following code.
<?php $event = $form->data['event'];
switch ($event) {
case "edit":
return 'event_a';
break;
case "delete":
return 'event_b';
break;
default:
return 'event_d';
}
?>
For each state I can then put different email and thanks messages if it worked, but it just seems to ignore the states & code and do a default db save. Why?