I have a simple form
<asp:TextBox ID="txtUsername" runat="server" CssClass="watermarkOn" TabIndex="1" />
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password" CssClass="watermarkOn" TabIndex="2" />
<asp:LinkButton ID="btnLogin" runat="server" CssClass="imgbtn_login" TabIndex="3" Text="login" onclick="btnLogin_Click" CausesValidation="false" />
With the following jQuery
$(document).ready(function () {
$("#<%=txtUsername.ClientID %>").keydown(function (event) {
if (event.keyCode == 13) {
eval($("#<%=btnLogin.ClientID %>").attr('href'));
}
});
$("#<%=txtPassword.ClientID %>").keydown(function (event) {
if (event.keyCode == 13)
{
eval($("#<%=btnLogin.ClientID %>").attr('href'));
}
});
});
This works perfectly fine in FF, IE7, IE 9, Chrome, Safari....with one exception. Certain IE8 installations it works for the username box, but not for the password box. Does anyone know WHY this might be the case. I don't see any documentation around a difference in behavior for Password boxes.
Update
I've also tried keyup, as well as event.which, neither of which work either. Username box works fine, but the password box does not trigger like it should.