I have an asp:TextBox on my page and I would like to detect the enter key to call a javascript function. This is what I have:
Codebehind
txtSearch.Attributes.Add("OnKeyPress", "ProcessKeyPressed()")
aspx page
function ProcessKeyPressed() {
if (event.keyCode == 13 || event.keyCode == 10 ) {
Search();
}
}
This works in chrome and IE, but not in Firefox...any idea why this might be the case?
Thanks in advance,