The novalidate attribute in the <form> tag is used to disable automatic form validation during submission. It allows the form to be submitted even if input fields contain invalid data.
- Disables built-in HTML form validation.
- Allows submission of incomplete or invalid form data.
- Commonly used when validation is handled using JavaScript.
Syntax:
<form novalidate>
<!-- form elements -->
</form>
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>
<head>
<title>
HTML <form> novalidate Attribute
</title>
</head>
<body style="text-align:center;">
<h1>
GeeksForGeeks
</h1>
<h2>
HTML <form> novalidate Attribute
</h2>
<!--Driver Code Ends-->
<form action="#"
method="get"
target="_self"
novalidate>
Name:
<input type="text">
<input type="submit"
id="Geeks"
name="myGeeks"
value="Submit @ geeksforgeeks"
formTarget="_blank">
</form>
<!--Driver Code Starts-->
</body>
</html>
<!--Driver Code Ends-->