Including novalidate attribute into Symfony2 twig template
You need a key/value pair:
{{ form_start(contact, {attr: {novalidate: 'novalidate'}}) }}
If you want to add novalidate
in all the forms of your app, create a twig template like this:
{% extends 'form_div_layout.html.twig' %}{# FORM START #}{% block form_start %}<form action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %} novalidate>{% endblock form_start %}
You can set form novalidate attribute to symfony 2 form object like this
$form = $this->createForm(new ClientType(), $clientEntity, array( 'action' => $this->generateUrl('client_create'), 'method' => 'POST', 'attr'=>array('novalidate'=>'novalidate') //add novalidate attribute to form));