In Form I have added code for checkbox as follows.
$fieldset->addField('title', 'checkboxes', array(
'label' => Mage::helper('custommodule')->__('Title'),
'class' => 'validate-one-required-by-name',
'name' => 'title[]',
'values' => array(
array('value'=>'aaa','label'=>'Checkbox1'),
array('value'=>'bbb','label'=>'Checkbox2'),
array('value'=>'ccc','label'=>'Checkbox3'),
),
'onclick' => "",
'onchange' => "",
'disabled' => false,
'tabindex' => 1
));
I got 3 checkbox field. If I dont choose any option and if then i click Submit. My form submitted. I want to add validation to these checkbox that one of the checkbox must select before submit.
As per This link. I have tried to add class validate-one-required for validation but it doesnt apply to checkbox. I want magento system to validate. Please help me anybody know. Thanks in advance.