- 相關(guān)推薦
jquery submit()不能提交表單的的原因
復制代碼 代碼如下:
用戶(hù)名:
密碼:
郵箱:
改為
$("#submit").click(function() {
$("form").submit();
});
上述代碼點(diǎn)擊注冊按鈕時(shí)無(wú)法提交表單
原因
Additional Notes:
Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures. For a complete list of rules and to check your markup for these problems, see DOMLint.
其他注意事項:
表單和其子元素不宜用一個(gè)表單的屬性的屬性作為name或id的名稱(chēng),如submit, length, or method,是、會(huì )產(chǎn)生沖突。名稱(chēng)沖突可能會(huì )導致混亂的失敗。對于一個(gè)完整的規則列表,并檢查這些問(wèn)題標記,看DOMLint。
所以將注冊按鈕的id改為“register”就OK了
【jquery submit()不能提交表單的的原因】相關(guān)文章:
jquery提交按鈕的代碼07-28
喝中藥不能加糖的原因08-30
內存不能為written原因10-09
太極拳不能自學(xué)的原因10-19
jQuery程序設計08-05
學(xué)生不能掌握拳腿功夫的原因10-26
五筆不能做速錄的原因10-21
jQuery中prev()方法用法07-16