Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 disable HTML5 form validation

Tags:

html

php

symfony

I want to validate my form using server side validation only. However, if the browser supports HTML5 it validates using the HTML5 attributes added to the form by symfony2 so I need to prevent HTML5 validation.

like image 519
user1331787 Avatar asked Apr 13 '12 14:04

user1331787


1 Answers

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'}}) }} 
like image 117
Ondrej Slinták Avatar answered Sep 21 '22 04:09

Ondrej Slinták