Does anyone know why the Onkeydown() event does not work for delete and backspace key in IE? It works fine for number and character keys.
A:
Are you sure? .. the following sees delete and backspace fine on IE:
<html>
<head>
<script type="text/javascript">
function keypress(e)
{
var keycode;
if (window.event) // IE
{
keycode = e.keyCode;
}
else if (e.which) // Netscape/FF/Op
{
keycode = e.which;
}
alert(keycode);
}
</script>
</head>
<body>
<form>
<input type="text" onkeydown="return keypress(event)" />
</form>
</body>
</html>
Scott Evernden
2009-03-20 04:36:27
yes, not sure why this is not call to the function at all if pressing backspace or delete
Jin Yong
2009-03-20 04:49:19