Skip to content

Instantly share code, notes, and snippets.

@jakefentress
Created June 30, 2014 19:30
Show Gist options
  • Save jakefentress/18a2085e5c6b310f226e to your computer and use it in GitHub Desktop.
Save jakefentress/18a2085e5c6b310f226e to your computer and use it in GitHub Desktop.
What's a nice way to tell the browser to ignore all HTML5-related validation, and take over the entire process?
<!-- Simple, just add the novalidate property to any element you don't want the browser to validate, like so: -->
<form>
<input type="email" name="email" required novalidate />
<input type="password" name="password" required />
<button type="submit">Log in</button>
</form>
<!--
Since you wish to only cancel validation when JavaScript is available, add it with JavaScript (using jQuery for simplified example)
$('input[novalidate]').attr('novalidate', 'novalidate');
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment