Created
June 30, 2014 19:30
-
-
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?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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