I am facing an issue with the onkeydown property in a JavaScript function that triggers an alert. While it works perfectly fine in Chrome and Firefox, it seems to be failing in Internet Explorer 9. The keydown, keyup, and keypressed events do not seem to work in IE9. Here is the code snippet I used for testing:
Here is the JavaScript function:
function method()
{
alert("hi");
}
And here is how it is called within an ASP TextBox element:
<asp:TextBox id ="tb" runat = "server" onkeydown = "method();"/>
I have tried calling the function using both onkeydown = "method();"
and
onkeydown = "method(); return false;"
, but none of them seem to work.
It's worth noting that the program where I intend to use this has a textBox extender, which means regular HTML won't suffice in this scenario ^_^'
Unfortunately, due to client confidentiality reasons, I cannot share too much of the original source code.
If you have any suggestions or insights on how to resolve this issue, I would greatly appreciate it!