From w3c schools we have these definitions:
novalidate:
When present, it specifies that the form-data (input) should not be validated when submitted.
formnovalidate:
When present, it specifies that the element should not be validated when submitted.
Does it make any difference using formnovalidate in the submit button insted of using novalidate in the form?
(I really don't get the difference)
The formnovalidate attribute is a boolean attribute. When present, it specifies that the <input> element should not be validated when submitted. The formnovalidate attribute overrides the novalidate attribute of the <form> element. Note: The formnovalidate attribute can be used with type="submit" .
The novalidate attribute is a boolean attribute. When present, it specifies that the form-data (input) should not be validated when submitted.
novalidate attribute is used to disable browser's native form validation. You can use it when you need do your own AngularJS custom validation.
The novalidate attribute simply tells the browser to disable the built-in HTML5 validation, or ignore any HTML5 validation attributes you may have used. The jQuery Validate plugin dynamically adds the novalidate attribute because, by installing it, you've decided to let the plugin handle validation instead of HTML5.
novalidate
is applied to the form, and prevents it from being validated; formnovalidate
is applied to a submit button, and overrides the novalidate
option, if present; it means 'submit this form without validating, regardless of the general form setting'.
The example given in the spec is when a user is saving data rather than publishing it; the data might be incomplete and invalid, but doesn't require validation to be saved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With