回车激发按钮
1.回车激发整个页有效
<body onkeypress="ProcessKeyPress();">
2.对某html输入标记有效
<input onkeypress="ProcessKeyPress();">
对服务器控件设置为
this.textbox1.Attributes["okkeypress"]="ProcessKeyPress();";
ProcessKeyPress:
function ProcessKeyPress()
{
if (event.keyCode == 13)
{
document.getElementById("Button1").click();//假定此按钮提交页面
![]()
}
}