Cross browser cancel keystrokes
Posted: Sun Dec 04, 2005 3:31 pm
The below code doesn't work AT all in Firefox and I haven't even tried in IE
Anyone know if this is possible to cancel a keystroke in firefox???
I can't decide if I hate firefox more or just dealing with javascript in general
Anyone know if this is possible to cancel a keystroke in firefox???
I can't decide if I hate firefox more or just dealing with javascript in general
Code: Select all
<input type="text" onkeydown="return cancel_key()" />
function cancel_key(e)
{
var keyCode = (document.all) ? event.keyCode : e.which;
if(keyCode == 32)
return false;
else
return truel;
}