Checkboxes - Email shows blank {fieldname}

dw1 03 Sep, 2012
Hi

All works fine with checkbox items in form when a user selects one of the checkboxes.

The problem: When no checkboxes are selected the field name shows in our email copy that is populating the data from the form.

e.g. Optional Functions: {functions}

History:
Experienced a similar issue that we've solved in past versions of chronoforms.
Added this to the On Submit box:
  <?php
    $check_array = array(
	  'function'
    );
    foreach ( $check_array as $v ) {
      $temp = JRequest::getString($v, '', 'post');
      JRequest::setVar($v, $temp);
    }
    ?>


Unfortunately, this is not working.
I had added to the On Submit box using Custom Server Side Validation action.


HTML looks like this:
                <input name="function[]" id="job" value="Job Posting/Recruitment" type="checkbox" />
                <input name="function[]" id="event_reg" value="Event Registration" type="checkbox" />
                <input name="function[]" id="calendar" value="Calendar" type="checkbox" />



Thanks in advance for your help.
Max_admin 03 Sep, 2012
Hi,

If this is V4 and the form is created using the wizard then you should enable the "ghost" mode for the checkboxes, if you have a custom code form then you can add a hidden field before your checkboxes and give it the same name as your checkboxes, but without the []

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
dw1 03 Sep, 2012
Thanks Max.

I read the FAQ post about "Replace Nulls" in the "Email" Template box. That did the trick.

For others reading this:
[list]* Using v4
* Custom code[/list]
Max_admin 04 Sep, 2012
No problems, I forgot about the replace nulls setting!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.