简体   繁体   中英

Disable HTML5 form validation for multiple forms

In an HTML page, there have 5 different forms. Four of them are in the bootstrap modal. HTML5 validation pops up for all forms on the main form submit. How can we disable the HTML5 validation for the forms other than submitting the form?

The HTML5 validation popup for the forms other than the main form was appearing on submitting the main form because one of the forms was not closed properly. So the scope of the form affected the problem and treated as a single form and so the HTML5 validation.

Add the novalidate attribute to the form tag:

<form name="something" novalidate></form>

Ref: https://www.w3.org/TR/html5/sec-forms.html#element-attrdef-form-novalidate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM