- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to specify that the form should not be validated when disabled in HTML?
59 Lectures 8.5 hours
68 Lectures 8 hours
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…
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>
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.
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>
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.
- 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 an <input> element should be pre-selected when the page loads 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 that the element must be filled out before submitting the form in HTML?
- How to specify whether the content of an element should be translated or not in HTML?
- How to specify where to send the form-data when a form is submitted in HTML?
- How do we specify that the list order should be descending (9,8,7, 6, 5...) 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?
- When to use new operator in C++ and when it should not be used?