Forums

email template

jrthor2 07 Aug, 2010
I have a form that is sending me the emails fine, but for fields that are left blank on the form (not required), espcially checkbox fields, in the email tha is sent, it shows {checkbox_name}. If the fields is blank or not checked, can this value just show blank in the email?

Thanks
GreyHead 07 Aug, 2010
Hi jrthor2,

Unchecked checkboxes don't return anything in the form results and ChronoForms doesn't know that this means an 'empty' result. So you have to add the check in the OnSubmit Before box. This code will do the trick:
<?php
$checkbox_name = JRequest::getString('checkbox_name', '', 'post');
JRequest::setVar('checkbox_name', $checkbox_name);
?>


Bob
This topic is locked and no more replies can be posted.