S
Stephen
Hi,
I have made use of javascript to make use of enter key, I hit "enter" and
the button fires....this piece of code works only for IE and not for
Netscape. In Netscape, I have to click the button.
the code is:
function doLogin()
{
if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all("btnLogin").click();return false;
}
else
{
return true;
}
}
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td><INPUT id="txtLogin" type="text" name="txtPost" runat="server"
onkeydown="doLogin()"></td>
<td><INPUT id="btnLogin" type="button" value="Login" name="btnPost"
runat="server"></td>
</tr>
</table>
</form>
private void btnLogin_ServerClick(object sender, System.EventArgs e)
{
Response.Write("<br>Login is fired at: " +
DateTime.Now.ToLongTimeString());
}
please advice,
Stephen
I have made use of javascript to make use of enter key, I hit "enter" and
the button fires....this piece of code works only for IE and not for
Netscape. In Netscape, I have to click the button.
the code is:
function doLogin()
{
if ((event.which && event.which == 13) || (event.keyCode &&
event.keyCode == 13))
{
document.all("btnLogin").click();return false;
}
else
{
return true;
}
}
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td><INPUT id="txtLogin" type="text" name="txtPost" runat="server"
onkeydown="doLogin()"></td>
<td><INPUT id="btnLogin" type="button" value="Login" name="btnPost"
runat="server"></td>
</tr>
</table>
</form>
private void btnLogin_ServerClick(object sender, System.EventArgs e)
{
Response.Write("<br>Login is fired at: " +
DateTime.Now.ToLongTimeString());
}
please advice,
Stephen