Jquery submit()無法提交問題
更新時(shí)間:2013年04月21日 15:31:15 作者:
代碼點(diǎn)擊注冊(cè)按鈕時(shí)無法提交表單,名稱沖突可能會(huì)導(dǎo)致混亂的失敗,接下來為大家介紹下解決方法,感興趣的朋友可以了解下
復(fù)制代碼 代碼如下:
<form action="register.php" method="post">
<div class="loginform_row">
<label>用戶名:</label>
<input type="text" class="loginform_input" id="name" name="name" /><div id="nameerror"></div>
</div>
<div class="loginform_row">
<label>密碼:</label>
<input type="text" class="loginform_input" id="pass" name="pass" /><div id="passerror"></div>
</div>
<div class="loginform_row">
<label>郵箱:</label>
<input type="text" class="loginform_input" id="email" name="email" /><div id="emailerror"></div>
</div>
<div class="loginform_row">
<input type="button" class="loginform_submit" id="submit" value="注冊(cè)" />改為<input type="button" class="loginform_submit" id="register" value="注冊(cè)" />
</div>
<div class="clear"></div>
</form>
$("#submit").click(function() {
$("form").submit();
});
上述代碼點(diǎn)擊注冊(cè)按鈕時(shí)無法提交表單
原因
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.
其他注意事項(xiàng):
表單和其子元素不宜用一個(gè)表單的屬性的屬性作為name或id的名稱,如submit, length, or method,是、會(huì)產(chǎn)生沖突。名稱沖突可能會(huì)導(dǎo)致混亂的失敗。對(duì)于一個(gè)完整的規(guī)則列表,并檢查這些問題標(biāo)記,看DOMLint。
所以將注冊(cè)按鈕的id改為“register”就OK了
您可能感興趣的文章:
- jQuery使用ajaxSubmit()提交表單示例
- Jquery ajaxsubmit上傳圖片實(shí)現(xiàn)代碼
- jquery的ajaxSubmit()異步上傳圖片并保存表單數(shù)據(jù)演示代碼
- jquery ajaxSubmit 異步提交的簡單實(shí)現(xiàn)
- 解決jquery submit()提交表單提示:f[s] is not a function
- jquery中使用$(#form).submit()重寫提交表單無效原因分析及解決
- 在jQuery ajax中按鈕button和submit的區(qū)別分析
- JQuery與JS里submit()的區(qū)別示例介紹
- jQuery ajaxSubmit 實(shí)現(xiàn)ajax提交表單局部刷新
- jquery submit()不能提交表單的解決方法
相關(guān)文章
jQuery Jcrop插件實(shí)現(xiàn)圖片選取功能
今天我們要在ASP.NET中用jQuery.Jcrop插件實(shí)現(xiàn)圖片的選取功能,你想選取美女的哪個(gè)部位你說了算,我就管不著了2011-11-11
jquery獲取被勾選的checked(選中)的那一行的3列和4列的值
大家可能會(huì)遇到這種需求通過jquery獲取被勾選的checked的那一行的3列和4列的值,具體的實(shí)現(xiàn)如下,感興趣的朋友可以參考下哈,希望對(duì)大家有所幫助2013-07-07
基于jquery的Repeater實(shí)現(xiàn)代碼
本文和大家詳解如何使用javascript來實(shí)現(xiàn)一個(gè)asp.net 的Repeater控件,叫jQuery.Repeater插件。一起來看下吧。2010-07-07
jQuery實(shí)現(xiàn)鼠標(biāo)經(jīng)過提示信息的地圖熱點(diǎn)效果
這是一個(gè)升級(jí)版本,更新了一個(gè)在IE8里的小問題,加入了提示框的內(nèi)容自動(dòng)換行處理(北京點(diǎn)上有演示)!估計(jì)差不多該是最后樣式了。IE6、IE8、谷歌、火狐、測(cè)試正常。2015-04-04
jQuery實(shí)現(xiàn)頁碼跳轉(zhuǎn)式動(dòng)態(tài)數(shù)據(jù)分頁
本片文章教給大家用jQuery實(shí)現(xiàn)頁碼跳轉(zhuǎn)式動(dòng)態(tài)數(shù)據(jù)分頁,效果非常好而且沒有頁面刷新,需要的朋友學(xué)習(xí)下吧。2017-12-12

