登录问题
<table>
<tr>
<td>
<asp:TextBox ID= "tbSelect " runat= "server " TabIndex= "1 " > </asp:TextBox>
<asp:LinkButton ID= "lbSelectK " runat= "server " TabIndex= "2 " Text= "快速检索 " OnClick= "lbSelectK_Click " />
</td>
</tr>
</table>
我想在第一个输入框中输入内容后,直接回车就触发按钮事件,不知道怎么实现,请大家帮忙
[解决办法]
通过客户端脚本..
function OnKeyDownPressEnter()
{
if (13 == event.keyCode)
{
document.form.submit();
}
}
<asp:LinkButton ID= "lbSelectK " runat= "server " TabIndex= "2 " Text= "快速检索 " OnClick= "OnKeyDownPressEnter() " />
[解决办法]
TextBox1.Attributes.Add( "onkeydown ", "if(event.keyCode==13) {document.all. " + Button1.ClientID + ".focus();document.all. " + Button1.ClientID + ".click();} ");