欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Jquery submit()無(wú)法提交問(wèn)題

 更新時(shí)間:2013年04月21日 15:31:15   作者:  
代碼點(diǎn)擊注冊(cè)按鈕時(shí)無(wú)法提交表單,名稱(chēng)沖突可能會(huì)導(dǎo)致混亂的失敗,接下來(lái)為大家介紹下解決方法,感興趣的朋友可以了解下
復(fù)制代碼 代碼如下:

<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了

相關(guān)文章

最新評(píng)論