On Thu, Nov 13, 2008 at 17:01, Matthew Weier O'Phinney <[EMAIL PROTECTED]> 
wrote:
> You have several options. First, you can declare the element an array:
>
>    $element->setIsArray(true);
>
> Second, you can use subforms to group related items -- this will create
> array notation by default.
>
> In your example, declare the MultiCheckbox as an array.

Using setIsArray or subForm doesn't work, my square brackets are still
stripped from the original name, and an empty sets of square brackets
is appended at the element's name.

$e = $f->createElement('multiCheckbox', 'question[42]');
// I've also tried with "question[42][]"
$e->setIsArray(true);
$e->setMultiOptions(array(
        'Checkbox 1',
        'Checkbox 2',
        'Checkbox 3',
));
$f->addElement($e);

If obtain this :
<input name="question42[]" value="0" />

While I want this :
<input name="question[42][]" value="0" />

-- 
Julien Huang

Reply via email to