Getting key code in Firefox from webforms textbox keydown event
Getting key code in Firefox from webforms textbox keydown event My textbox is declared thus: <asp:TextBox ID="txtShowManyItemTag" CssClass="price" onkeydown="return txtShowManyItemTagKeyUp(this);" TabIndex= "997" runat="server" Text="" Width="50px" /> The javascript function called is: function txtShowManyItemTagKeyUp(txt) if (window.event.keyCode == 13 && txt.value != '') var nextRow = $(txt).closest('tr').next(); if (nextRow.length > 0) $(txt).closest('tr').next().find(".price").select(); else $("#<%=btnOkMany.ClientID %>").select(); return false; In Chrome and IE, the window.event.keyCode == 13 correctly detects the Enter key being pressed, but I have been unable to find the equivalent for Firefox. Note that I am not passing an event, I'm passing the control that's triggering the event, and I can find no way to get the key code...