关于回车的一个灵异问题
<table style= "width: 698px; ">
<tr>
<td style= "width: 100px; text-align: right; font-size: 9pt; word-break:keep-all ">
添加一个新的Email:
</td>
<td >
<asp:TextBox ID= "txtNewEmail " runat= "server " BorderStyle= "Groove " onkeydown= "if(event.keyCode==13) {document.all.btnAdd.focus();document.all.btnAdd.click();} "> </asp:TextBox>
<asp:Button ID= "btnAdd " runat= "server " Text= "确定 " OnClick= "btnAdd_Click " />
</td>
</tr>
</table>
我在txtNewEmail的时候回车,有时候btnAdd竟点击了两次.大家帮忙看一看
------解决方案--------------------onkeydown= "if(event.keyCode==13) {document.all.btnAdd.focus();document.all.btnAdd.click();return false;} "