Hello!
In a project i'm extending the Zend_Form to create a form, in this form in need to use Zend_Form_Element_MultiCheckbox for listing a series of elements coming from a db query, but i also need to set any of this as checked (with the html attributer checked= "checked") how can do this?
Here below the code that i use to generate the component
PHP Code:
$group = new Zend_Form_Element_MultiCheckbox('groups');
$group->setLabel('Groups');
$groups = new Groups();
$groupsRows = $groups->fetchAll();
foreach ($groupsRows as $groupsRow ){
$group->addMultiOption($groupsRow->id,$groupsRow->name);
}