I would like how could a make that my first option of an EntityType is NULL.
I've tried with a placeholder, but is not possible because when I try to register the form it obligate to select a different option which is not the place holder.
I'm trying something like this:
->add('idacademicprogram', EntityType::class, array(
"class" => 'AppBundle:Academicprogram',
'placeholder' => 'Choose an option',
"attr"=>array(
"class" => "form-iduser form-control",
"required" => false
)))
Ok i fixed changing required on global array, not on attr.
Would be something like this:
->add('idacademicprogram', EntityType::class, array(
"class" => 'AppBundle:Academicprogram',
'placeholder' => 'Choose an option',
'required' => false,
"attr"=>array(
"class" => "form-iduser form-control"
)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With