->add("document_type", ChoiceType::class, [ "choices_as_values" => true, "choices" => [ "Create new document" => "1", "Upload file" => "2" ], 'choice_attr' => function ($val, $key, $index) { if ($index == 1) { return ['checked' => true]; } else { return []; } }, "attr" => ["class" => "hide_switch"], "label_attr" => ["class" => "test"], "expanded" => true, "multiple" => false, "mapped" => false ]) 

enter image description here

required => false Do not offer

    1 answer 1

    What does not like required = false ?

    Otherwise, you need to edit already at the level of the widget output. I don't know which engine you use, but I guess twig. Then the output should be approximately as follows:

     form_widget(form.document_type, {attr: {required: false} }) 

    Instead of false, you can try null.