Click here to Skip to main content
15,885,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
I am developing an application in which i want to disable f5 and backspace keys
for mozilla ,firerfox browsers.I have tried lots of code but didn't get the proper result. I just want to avoid reloading of page.If you have better option plz help.
Posted

try this if you just want to disable the F5 and Backspace functionality:
keyCode 116 ==> F5 key
keyCode 8 ==> Backspace

C#
function disableF5BackSpace(e){
    evt = e || window.event;

    if(evt.keyCode == 116 || evt.keyCode == 8){
        evt.preventDefault();
    }
}


Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900