Skip to content

[Form] Choice field with radio buttons can't have an empty value #3153

Closed
@webmozart

Description

@webmozart

When creating an expanded, single choice field with an empty choice

$form = $this->createFormBuilder()
    ->add('color', 'choice', array(
        'choices' => array(
            '' => 'Empty',
            '990000' => 'Red',
            '009900' => 'Green',
        ),
        'expanded' => true,
    ))
    ->getForm()
;

I get the error

Form with empty name can not have parent form.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions