I'm trying to display a conditional confirmation message based on a checkbox being ticked or not in my form. I've searched the forums for this answer and cannot seem to find it.
Here is the code:
function custom_confirmation($confirmation, $form, $lead, $ajax){
if (isset($lead[3]) && $lead[3] == 1) {
$confirmation = array("redirect" =>"http://www.drumblebee.com/login?error=youhaveanerror");}
else {$confirmation = array("redirect" =>"http://www.drumblebee.com/login/");}
return $confirmation;
}
The problem is despite me checking (or unchecking) the box, the $lead does not seem to recognize the form value.
The form code is:
<input name='input_3.1' type='checkbox' value='1' id='choice_3_1' tabindex='3' />
Any help would be appreciated. I'm sure it's something very small I'm missing.
Thanks,
Tony