I have a text box on a webpage which upon pressing the enter key, it should do something. So I detect the key code for the Enter key onkeyup.
My issue is, it appears that any JavaScript key events (keypress, keydown, keyup) do not work in the Windows Mobile 5 IE browser? I've tried onlblur as well. I'm looking for a JavaScript solution ideally.
I've seen some suggestions on the web about setting KeyPreview to true, but that appears to be only for Windows Forms.
HTML example (seems to work fine in situations other than this):
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function isEnterPressed(){
if (window.event.keyCode == 13) {
alert("Enter was pressed!");
}
}
</script>
</head>
<body onload="document.getElementById('txtEntry').focus();">
<span>
Press the enter key...if enter is detected, message will display below.
</span>
<br />
<input type="text" id="txtEntry" onkeyup="isEnterPressed()">
</body>
</html>