I am trying to get mchimpx to only fire when a checkbox on a contact form is checked. I have tried getting the checkbox value and using a conditional statement to either run or bypass the rest of the snippet, but it isn't working:
// get form values
$values = $hook->getValues();
$confirmsignup = $values['newsletter'];
if ($confirmsignup == "subscribe") {
// rest of snippet code
} else {
return true;
}
newsletter being the name of the form field and
subscribe the value when checked. This is how I setup the form field:
<input name="newsletter" type="checkbox" [[!+fi.newsletter:FormItIsChecked=`subscribe`]] value="subscribe" />
Can anyone give me an idea of what I am doing wrong?
Ben Morrison
Hacking templates to pieces since 2003