What's the difference between novalidate and formnovalidate attributes of HTML5?

后端 未结 1 1429
离开以前
离开以前 2020-12-25 10:42

From w3c schools we have these definitions:

novalidate:

When present, it specifies that the form-data (input) should

1条回答
  •  独厮守ぢ
    2020-12-25 10:54

    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.

    0 讨论(0)
提交回复
热议问题