Tuesday, July 28, 2015

Symfony - to disable browser's validation

Generated forms take full advantage of this new feature by adding sensible HTML attributes that trigger the validation. The client-side validation, however, can be disabled by adding the novalidate attribute to the form tag or formnovalidate to the submit tag.

{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
    <!-- start -->
    {{ form_widget(form) }}
    <!-- end -->
{{ form_end(form) }}

Reference:

http://symfony.com/doc/current/book/forms.html

No comments: