Skip to content

Checkbox get two "[][]" if using modify #305

Open
@SebTM

Description

@SebTM

Hello,

if I use modify on field-type "choice" I get html like "fieldName[][]" as name attribute. Here is my controller-code to reproduce:

public function testModify()
    {
        $form = FormBuilder::plain()
            ->add('name', 'text')
            ->add('test', 'choice', [
                'choices' => ['en' => 'English', 'fr' => 'French'],
                'choice_options' => [
                    'wrapper' => ['class' => 'choice-wrapper'],
                    'label_attr' => ['class' => 'label-class'],
                ],
                'expanded' => true,
                'multiple' => true
            ]);

        $form->modify('test', 'choice', [
            'rules' => 'required',
        ]);

        $form->add('submit', 'submit');

        return View::make('cdou.form', ['form' => $form]);
    }

Best Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions