Reputation: 3033
I need to render a MultiCheckbox like below:
<label>
<input type="checkbox" name="privacy[read_only]" value="1" /> Just for read only
</label>
<label>
<input type="checkbox" name="privacy[is_pulic]" value="1" /> Is public
</label>
How can I do that? I just can do with:
<label>
<input type="checkbox" name="privacy[]" value="read_only" /> Just for read only
</label>
<label>
<input type="checkbox" name="privacy[]" value="is_pulic" /> Is public
</label>
Thanks so much for any your ideas.
Upvotes: 0
Views: 324
Reputation: 5141
If there was nothing else in your form, or you didn't mind each form element having the same format, you could use setElementsBelongTo($array)
which is a method on a Zend_Form
.
You might also then have to use individual checkboxes to acheive the desired markup, so this may or may not work in your scenario.
Upvotes: 1