php - Symfony form: disable "required" for a field from Twig -
i'm trying disable frontend html5 validation filed in form built in symfony.
in twig, use code:
{{ form_widget(form.email, {'attr': {'class': 'form-control input-lg','novalidate': 'novalidate}}) }}
but field still considered required. doing wrong?
you can set in form type disable field validation.
->add('test', null, array( 'required' => false ))
if want disable whole field can try this:
{{ form_start(form, { attr: {novalidate: 'novalidate'} }) }}
Comments
Post a Comment