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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -