Button formNoValidate Property

Definition and Usage

formNoValidate Property sets or returns whether form data should be validated when submitted.

This property is only used for buttons with type="submit".

When set to true, this property adds the "formnovalidate" attribute to the "submit" button and specifies that form data should not be validated when submitted. This overrides the form's novalidate attribute.

Note:formnovalidate attribute It is a new property of the <button> element in HTML5.

Instance

Example 1

Determine whether the form data should be validated:

var x = document.getElementById("myBtn").formNoValidate;

Try it yourself

Example 2

Set the formNoValidate property:

document.getElementById("myBtn").formNoValidate = false;

Try it yourself

Syntax

Return the formNoValidate property:

buttonObject.formNoValidate

Set the formNoValidate property:

buttonObject.formNoValidate = true|false

attribute value

value description
true|false

Specifies whether form data should be validated when submitted

  • true - Form data should not be validated
  • false - Default. Form data should be validated

Technical Details

Return Value: Boolean value, returns true if form data should not be validated, otherwise returns false.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support

Related Pages

HTML Reference Manual:HTML <button> formnovalidate Attribute