Symfony2 disable HTML5 form validation

Solution 1:

Just add novalidate to your <form> tag:

<form novalidate>

If you are rendering the form in TWIG, you can use following.

{{ form(form, {'attr': {'novalidate': 'novalidate'}}) }}

Solution 2:

I know its old question but with SF2.6 in FormType, you can do:

/**
 * @param OptionsResolverInterface $resolver
 */
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
    $resolver->setDefaults(array(
        'attr'=>array('novalidate'=>'novalidate')
    ));
}