HTML 5 <button> formnovalidate 屬性
實(shí)例
帶有兩個(gè)提交按鈕的表單(進(jìn)行驗(yàn)證或不進(jìn)行驗(yàn)證):
<form action="demo_form.asp" method="get">
E-mail: <input type="email" name="userid" /><br />
<button type="submit" >提交</button><br />
<button type="submit" formnovalidate="formnovalidate"
>進(jìn)行沒有驗(yàn)證的提交</button>
</form>
定義和用法
formnovalidate 屬性覆蓋表單的 novalidate 屬性。
如果使用該屬性,則提交表單時(shí)按鈕不會(huì)執(zhí)行驗(yàn)證過(guò)程。
該屬性與 type="submit" 配合使用。
HTML 4.01 與 HTML 5 之間的差異
formnovalidate 屬性是 HTML 5 中的新屬性。
語(yǔ)法
<button formnovalidate="formnovalidate">