Disable HTML5 input native validation

Tue, Aug 12, 2014

HTML5 Programming #HTML5 #programming

In HTML5, we can now specify extra attribute to the input element, such as patternrequired and type. By default, browser will validate the form whenever user submit the form. If you are using third party Javascript validation tools like Parsley or JQuery Validation plugin, you will want to disable the browser validation. To disable it, we can just add a “novalidate” attribute to the form.


<form action="youraction.php" method="post" novalidate>
  <div><input type="email" required name="email" placeholder="Email"/></div>
  <div><input type="submit" value="Submit"></div>

Here are some sample codes I written in jsfiddle. I’ve created 2 forms, one with novalidate and one without novalidate. You can try it out and see. Enjoy.