I've got a syfmony form with type checkbox or radio. If no checkbox is selected data is not passed to post action.
For example if I have a form with two ChoiceType and i dont select anything from the second one i expect to see in post action something like
form[q1][]:4
form[q2][]:null
form[submit]:
Instead i get in post action:
form[q1][]:4
form[submit]:
I also trying to add in my form:
'required' => false,
and
'empty_data' => null,
but still continue having the same issue.
Anyways if i use
$form->handleRequest($request)
i've got empty values as expected but just because there isn't any request with the formName.
This is not what i need because I need to use
$form->submit($request->get($form->getName()), false);
So is there a way to pass to post also empty value? Thanks.