Forums

Chronoforms and Campaign Monitor

webfeuerflo 29 Aug, 2014
Hello,
I have created a form as a Newsletter-subscription with Campaign Monitor by adding a curl event to onSubmit with the pararms/fields map and it is working.
Now I would need the same form as a contactform but the newsletter subscription only if a certain checkbox is checked.

How can I do this?
I assume I should add an email-event to send the form but how can I get the curl event only to communicate with campaign monitor with the active checkbox and not when checkbox is inactive?

Thanks for your help!
webfeuerflo 30 Aug, 2014
ok, I installed the event switcher but I am not sure what I should do with it. How can I get to execute the curl action only if input_checkbox_59 is checked?
GreyHead 30 Aug, 2014
Hi webfeuerflo,

You need to add a little PHP to the action. It will be something like this
<?php
if ( $form->data['input_checkbox_59 '] == 'some value' ) {
  return 'event_a';
}
?>

The add the cURL action to the Event A box in the action.

Bob
webfeuerflo 30 Aug, 2014
thank you, I copied the code, put the curl action (that was working before) and put it in this newly created box. if I check this box and send the form I should get an email to confirm my subscription (which worked before), but this doesn't happen. obviously the curl action isn't executed the way it should.
GreyHead 30 Aug, 2014
Hi webfeuerflo,

There's no information in your post to give me any idea where your problem is. Pleas try adding a Debugger action to see what is happening. That should let you know if the cURL action is being executed or not.

I assume that you have replaced 'some_value' in the code with the value of your checkbox?

Bob
webfeuerflo 30 Aug, 2014
oh, stupid me! I need to put "checked" there, right?
GreyHead 30 Aug, 2014
Hi webfeuerflo,

Probably not, you need to put whatever the value of the check box is set to. Adding a Debugger will show you that - or you can check the options box in the CheckBox element.

Bob
webfeuerflo 30 Aug, 2014
this is what I get:
Notice: Undefined index: input_checkbox_59 in /var/www/vhosts/stastnik.at/httpdocs/cms/administrator/components/com_chronoforms/form_actions/custom_event_switch/custom_event_switch.php(19) : eval()'d code on line 2
This topic is locked and no more replies can be posted.