Disable F5 and BackSpace on Mozilla Firefox

E

Eli

Hi,

Since using IFRAMEs in my page, I want to disable the F5 and BackSpace
keys. I got this working on IE but not on Mozilla Firefox:


function CheckKey(evt)
{
evt=(evt)?evt:window.event;
switch (evt.keyCode)
{
case 8: //backspace
case 116: //F5
evt.cancelBubble=true;
evt.returnValue=false;
return false;
}
return true;
}

document.onkeydown=CheckKey;
document.onkeyup=CheckKey;


Does anyone knows how to make this work on Mozilla Firefox?

-thanks, Eli
 
E

Eli

Sorry.. forgot the most important line that makes it work under IE:

evt.keyCode=0;

But this line makes an error under Mozilla Firefox (trying to set a
value that has only a getter).

What is the right way to make it work under Mozilla Firefox?
 
R

Randy Webb

Eli said:
Hi,

Since using IFRAMEs in my page, I want to disable the F5 and BackSpace
keys.

Why? You are correcting the wrong problem.

I got this working on IE but not on Mozilla Firefox:

Depends upon your definition of "working".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top