电脑技术学习

javascript回车提交表单

dn001

input type=text name="hehe"; onkeydown="KeyDown()">

<script language="javascript">
function KeyDown()
{
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
Form1.btnsubmit.click();
}
}
</script>