Published on
If you need to run a particular action depending on the form results then there are four ways of doing this.
There are four actions that behave in this way.
- The Custom Serverside Validation action* will allow to to test 'true' or 'false' and add appropriate actions.
- My {rokbox text=|Event Switcher [GH] action| size=|1000,600| }http://greyhead.net/how-to-docs/cfv4-event-switcher-gh-action{/rokbox} allows you to have five options - four specific plus a fifth if you do nothing - (or more than five by using more than one Event Switcher); and
- My {rokbox text=|Email [GH] action| size=|1000,600| }http://greyhead.net/how-to-docs/cfv4-email-gh-action{/rokbox} squeezes in because it has a conditional check for the email built in so that you can send an email if, for example, a check box is ticked.
- User SloanThrasher has develped a new 'If then Else' action available here that lets you make a two way choice using the result of a PHP expression.
Apart from these actions you can use a Custom Code action to check a form result and redirect the user before any further actions are run.
* The Custom Serverside Validation action doesn't have to be used to do serverside validation - just add a PHP test that returns true or false and you can trigger the sub-events (though I recommend that you don't use the Success event, just put the on Success actions in the parent event, the effect is the same.

Comments: