I have created a component. I try to store the data from a xml form into the database. This works for all text fields but the field "checkboxes" makes problems.
Here is the xml code:
<field name="color" type="checkboxes" label="COM_COLOR" multiple="true">
<option value="1">red</option>
<option value="2">blue</option>
<option value="3">green</option>
<option value="4">yellow</option>
</field>
code in the edit.php
<?php echo $this->form->getInput('color'); ?>
It is exactly the same like the Joomla Documentation: http://docs.joomla.org/Checkboxes_form_field_type
But if I click to save the checkbox values was not stored in database. Can anyone help? thanks
Joomla version: 3.2.1
EDIT: NOW IT WORKS! Write the following code into the php file where the JTable was extend. (your_component/tables/your_file.php)
public function store($updateNulls = true)
{
JArrayHelper::toString($this->color);
$this->color= implode(',', $this->color);
return parent::store($updateNulls);
}