I made a simple form field with checkboxes
$form = new Varien_Data_Form();
$form->setHtmlIdPrefix('option_');
$form->setFieldNameSuffix('option');
$this->setForm($form);
$values = array(
array(
label => 'check1',
value => 'check1'
),
array(
label => 'check2',
value => 'check2'
)
);
$fieldset = $form->addFieldset(
'rules',
array('legend' => 'Rules'
);
$fieldset->addField(
'checks',
'checkboxes',
array(
'name' => 'checks',
'values'=> $values,
'after_element_html' => '<button type="button" onclick="saveAndContinueEdit()">Save</button>'
)
);
but when I save them, only the last(in array) checked checkbox gets saved in the database.
In my install script I have
->addColumn(
'checks',
Varien_Db_Ddl_Table::TYPE_TEXT, '64k',
array(),
'Checkbox Test'
)
Why it's not working?