Forums

Email results only if checkbox selected?

ctrlmedia 02 Dec, 2014
Hi guys,

As the title suggests, is it possible to allow the user to submit the form to save it (the easy part) --- BUT on finally completing the form they tick a checkbox which will then email the admin on submit and display a different message?

This is useful as the form is large so they might come back to it a few times.

Thanks in advance for any help.
Regards
Mark
GreyHead 02 Dec, 2014
Answer
Hi Mark,

Yes, you can control actions or groups of actions using the Event Switcher action in the form On Submit event.

I did this for a large form recently by having a status column in the database that was either empty, 'saved', or 'submitted'

When 'empty' i.e. a new record, or saved then editing was allowed but once set to ;submitted' the record was locked and no further editing permitted.

Bob
ctrlmedia 03 Dec, 2014
Thanks Bob,

I will look in to this and post my findings.
Regards
Mark
ctrlmedia 03 Dec, 2014
I got the Event Switcher working with the following example:
<?php
if ($form->data["model"]["field"] !=""){
return "success";
}else{
return "fail";
}
?>


Thanks again Bob.
GreyHead 03 Dec, 2014
Hi Mark,

Well done :-)

Bob

PS When you first create a new Event Switcher action you can change the list of actions from success,fail to something more useful e.g. no_email,email, two_emails, . . . and these will be created when you save the form.
This topic is locked and no more replies can be posted.