
- 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
How to specify that the form should not be validated when disabled in HTML?
In HTML, forms for user input are created using the <form> tag. The form tag uses a lot of different elements. When submitting a form, the novalidate attribute of the HTML <form> tag is used to indicate that the form-data should not be validated. This attribute is a Boolean one.
Following are the examples…
Example
In the following example we are using novalidate to make the form disabled after getting submitted.
<!DOCTYPE html> <html> <body style="text-align:center;"> <form action="#" method="get" target="_self" novalidate> Name: <input type="text"> <input type="submit" id="tutorials" name="mytutorials" value="Submit@tutorialspoint" formTarget="_blank"> </form> </body> </html>
Output
On executing the above script, the window will open up and display the input field along with a submit button. When clicked on the submit button, it will open in a new tab without any change because of the nonvalidated form.
Example
Another example to explain the novalidate attribute is shown below −
<!DOCTYPE html> <html> <head> <title>HTML novalidate attribute</title> </head> <body> <form action = "" method = "get" novalidate> Student Name<br><input type = "name" name = "sname"><br> Rank<br><input type = "number" name = "rank"><br> <input type = "submit" value = "Submit"> </form> </body> </html>
Output
On executing the above script, the window will open up and display the input fields student name and rank along with a submit button. When the submit button is clicked, it will open a new tab without any change because of the nonvalidated form.
- Related Articles
- How to specify that an element should be pre-selected when the page loads in HTML?
- How to specify that an option should be pre-selected when the page loads in HTML?
- How to specify that the details should be visible to the user in HTML?
- How to set that the specified element/group of elements should be disabled in HTML?
- How to specify that the element should automatically get focus when the page loads in HTML?
- How to specify whether the form-data should be encoded while submitting to the server with HTML?
- How to specify whether the content of an element should be translated or not in HTML?
- How to specify that the element must be filled out before submitting the form in HTML?
- How to specify where to send the form-data when a form is submitted in HTML?
- How to specify the HTTP method to use when sending form-data in HTML?
- How to specify if and how the author thinks the audio/video should be loaded when the page loads in HTML?
- How to specify that the target will be downloaded when a user clicks on the hyperlink in HTML?
- How to specify that an element is not yet relevant in HTML?
- How to specify whether the or the element should have autocomplete enabled in HTML?
- How to specify that the element is read-only in HTML?
