I know I can create a form multi checkbox using new Zend_Form_Element_MultiCheckbox(). I’m not using this syntax however. I’m using the form view helper syntax in the view, like so:
echo $this->formMultiCheckbox('boxes', null, null, $possible_vals_array, null);
My question is how do I, using this syntax, add an array for the values that need to be checked by default?
The second parameter of
$this->formMultiCheckbox()should be an array of values to have checked.So if you your
$possible_vals_arraylooks like this:… and say you want to have values A and C checked by default, you’d pass an array like this as the second parameter:
So your call to the helper would look like this: