jeudi 1 janvier 2015

symfony 2 form choice checkbox list return none when all checkboxes are unchecked

I have a form with checkbox list created as choice in symfony 2.3



$fieldProp['choices'] = $values;
$fieldProp['expanded'] = true;
$fieldProp['multiple'] = true;
$fieldProp['empty_data'] = Null;
$builder->add($value2['attrId'], 'choice', $fieldProp);


If i unchecked all the check boxes and submitting the form the request not contain the field. I am receiving the result as



$formValues = $request->request->get($form1->getName());


How can i solve the issue.





Aucun commentaire:

Enregistrer un commentaire