Jquery submit()無(wú)法提交問(wèn)題
<form action="register.php" method="post">
<div class="loginform_row">
<label>用戶(hù)名:</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í)無(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.
其他注意事項(xiàng):
表單和其子元素不宜用一個(gè)表單的屬性的屬性作為name或id的名稱(chēng),如submit, length, or method,是、會(huì)產(chǎn)生沖突。名稱(chēng)沖突可能會(huì)導(dǎo)致混亂的失敗。對(duì)于一個(gè)完整的規(guī)則列表,并檢查這些問(wèn)題標(biāo)記,看DOMLint。
所以將注冊(cè)按鈕的id改為“register”就OK了
- jQuery使用ajaxSubmit()提交表單示例
- Jquery ajaxsubmit上傳圖片實(shí)現(xiàn)代碼
- jquery的ajaxSubmit()異步上傳圖片并保存表單數(shù)據(jù)演示代碼
- jquery ajaxSubmit 異步提交的簡(jiǎn)單實(shí)現(xiàn)
- 解決jquery submit()提交表單提示:f[s] is not a function
- jquery中使用$(#form).submit()重寫(xiě)提交表單無(wú)效原因分析及解決
- 在jQuery ajax中按鈕button和submit的區(qū)別分析
- JQuery與JS里submit()的區(qū)別示例介紹
- jQuery ajaxSubmit 實(shí)現(xiàn)ajax提交表單局部刷新
- jquery submit()不能提交表單的解決方法
相關(guān)文章
jQuery獲取瀏覽器中的分辨率實(shí)現(xiàn)代碼
本篇文章小編為大家介紹,使用jQuery獲取瀏覽器中的分辨率的方法。需要的朋友參考下2013-04-04JQuery select控件的相關(guān)操作實(shí)現(xiàn)代碼
JQuery獲取和設(shè)置Select選項(xiàng)方法匯總?cè)缦?,需要的朋友可以參考?/div> 2012-09-09jquery實(shí)現(xiàn)從數(shù)組移除指定的值
這篇文章主要介紹了jquery實(shí)現(xiàn)從數(shù)組移除指定的值,涉及jQuery中g(shù)rep()方法對(duì)數(shù)組元素進(jìn)行過(guò)濾篩選的技巧,需要的朋友可以參考下2015-06-06jquery中EasyUI實(shí)現(xiàn)同步樹(shù)
本文主要是給大家分享了一則使用EasyUI實(shí)現(xiàn)同步樹(shù)的代碼,主要是使用遞歸實(shí)現(xiàn),非常實(shí)用的方法,推薦給小伙伴們。2015-03-03jquery學(xué)習(xí)筆記 用jquery實(shí)現(xiàn)無(wú)刷新登錄
為了防止以后好久不用生疏,在這里記下,供剛開(kāi)始學(xué)習(xí)jquery的童鞋們借鑒,我也是剛開(kāi)始學(xué)jquery,有什么寫(xiě)的不對(duì)的地方,還請(qǐng)大家指出錯(cuò)誤,共同進(jìn)步。2011-08-08AMD異步模塊定義介紹和Require.js中使用jQuery及jQuery插件的方法
這篇文章主要介紹了AMD異步模塊定義介紹和Require.js中使用jQuery及jQuery插件的方法,需要的朋友可以參考下2014-06-06jQuery實(shí)現(xiàn)數(shù)字自動(dòng)增加或者減少的動(dòng)畫(huà)效果示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)數(shù)字自動(dòng)增加或者減少的動(dòng)畫(huà)效果,涉及jQuery結(jié)合時(shí)間函數(shù)動(dòng)態(tài)設(shè)置元素屬性相關(guān)操作技巧,需要的朋友可以參考下2018-12-12jQuery+php實(shí)時(shí)獲取及響應(yīng)文本框輸入內(nèi)容的方法
這篇文章主要介紹了jQuery+php實(shí)時(shí)獲取及響應(yīng)文本框輸入內(nèi)容的方法,涉及jQuery響應(yīng)鍵盤(pán)事件及ajax調(diào)用php文件針對(duì)輸入內(nèi)容的處理與回調(diào)相關(guān)技巧,非常簡(jiǎn)單易懂,需要的朋友可以參考下2016-05-05最新評(píng)論