代码:
<!--禁止回车提交表单 -->
<FORM METHOD=POST ACTION="" id="doLogin" name="doLogin" οnkeydοwn="if(event.keyCode==13){return false;}"'>
<TABLE>
<TR>
<TD><INPUT TYPE="text" NAME="" οnkeydοwn="isEntry(event)"></TD>
</TR>
</TABLE>
</FORM>
<!--回车触发提交表单 -->
<SCRIPT LANGUAGE="JavaScript">
function isEntry(e){
if(document.all)e = event;
if(e.keyCode==13) {
alert("回车键");
document.forms['doLogin'].submit();
}
}
</SCRIPT>
index.php