Joomla checkboxes Form Field Type

The checkboxes form field type provides a set of checkboxes. Unlike most standard form field types, such as textfield or checkbox, this field is little different. It will create checkboxes, and submit their values in form of an array, but it will not store them in the database.

For example,

<field name="toppings" type="checkboxes">
<option value="anch">Anchovies</option>
<option value="chor">Chorizo</option>
<option value="on">Onions</option>
<option value="mush">Mushrooms</option>

The set of checkboxes can be generated in your form with a single statement like this:

<?php echo $this->form->getInput('toppings'); ?>

If the user checks the second and fourth item and submits the form, the Joomla server will provide the following result:

print_r(JRequest::getVar('jform')['toppings']) =>

[0] => chor
[1] => mush
Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive