HTML formnovalidate Attribute

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

The formnovalidate attribute is a boolean attribute that can be used in HTML forms to bypass the form validation upon submission. This attribute is specifically applicable to <button> or <input> elements of type submit. When present, it indicates that the form data should be submitted without being subjected to the usual validation checks that would otherwise be applied based on the form's or individual input fields' validation constraints (like required, pattern, etc.).

This attribute is particularly useful in scenarios where the form has multiple submit buttons, and the developer wishes to enforce validation only for certain actions. For example, a form might have both a "Save Draft" and a "Submit" button. By applying formnovalidate to the "Save Draft" button, the form can be submitted without requiring all fields to be completed, which might be necessary for a formal submission.

The use of formnovalidate provides flexibility in handling form submissions, allowing developers to customize the user experience based on the context of the submission. It's important to note that while formnovalidate can control client-side validation, developers should always ensure that necessary validation checks are also performed on the server-side to maintain data integrity and security.

Syntax

<tagname type="submit" formnovalidate>

Values

The formnovalidate attribute is a boolean attribute, therefore no values are associated with this attribute.

Applies To

The formnovalidate attribute can be used on the following html elements.

Example

<form novalidate action="formscript.php">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" required>
<br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email" required>
<br><br>
<input type="submit" value="Submit">
</form>

Browser Support

The following table will show you the current browser support for the HTML formnovalidate Attribute.

Desktop
Edge Chrome Firefox Opera Safari
YesYesYesYesYes
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
YesYesYesYesYesYes

Last updated by CSSPortal on: 29th March 2024