PDA

View Full Version : discarding key down for NS6+


wac
03-07-2003, 11:41 PM
basically, I want to filter out non-digits during an onkeydown
event (except for delete, backspace and escape)

In IE, within my onkeydown handler, I set event.returnValue = false when I want to ignore a key.
This doesn't work on NS6. The documentation says to use
event.preventDefault() but that doesnt work either.

How do I do this on NS6+?

Also, are the key codes the same for NS6+ and IE5+
meaning that once I know the escape, delete, backspace keycode
on one browser, can I use the same numbers on the other???

chrismiceli
03-08-2003, 01:03 AM
how are checking which key they hit, if in a function, do this trick

<body onKeyUp="return functionname()">

in the function

if(key!=whatyouwant) {
return false;
}
else
return true;