
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML novalidate Attribute
The HTML novalidate attribute define that while submitting the form the form data should not be validated in an HTML document.
Syntax
Following is the syntax −
<form novalidate></form>
Let us see an example of HTML novalidate Attribute −
Example
<!DOCTYPE html> <html> <style> body { color: #000; height: 100vh; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat; text-align: center; } input[type='text'] { width: 300px; padding: 8px 16px; border: 2px solid #fff; background: transparent; border-radius: 20px; display: block; margin: 1rem auto; outline: none; } .btn { background: #db133a; border: none; height: 2rem; border-radius: 20px; width: 330px; display: block; color: #fff; outline: none; cursor: pointer; margin: 1rem auto; } ::placeholder { color: #000; } </style> <body> <h1>HTML novalidate attribute Demo</h1> <form> <input type="text" placeholder="Enter your name" required> <input type="submit" value="Submit" class="btn" onclick='check()'> </form> <button type='button' class="btn" onclick="set()">Set No Validation</button> <div class="show"></div> <script> function set() { document.querySelector('form').setAttribute('novalidate', 'true'); } </script> </body> </html>
Output
Try to click on “Submit” button without entering any name in the text field, it will produce a warning message −
Now click on “Set No Validation” button to set novalidate attribute on the form element and now try to submit the form without entering any name in the text field, this time it will easily get submitted without showing any warning message
−
- Related Articles
- How to use a novalidate attribute in HTML?
- Why do we use the novalidate attribute in HTML?
- HTML pattern Attribute
- HTML maxlength Attribute
- HTML wrap Attribute
- HTML disabled Attribute
- HTML for Attribute
- HTML min Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- HTML min Attribute
- HTML draggable Attribute
- HTML href Attribute
- HTML max Attribute
- HTML enctype Attribute

Advertisements