huseyin_akturk
06-12-2005, 01:56 AM
Hi,
Firstly, I want to say I am new on javascript.
I want to remove backspace key. I mean that when user presses backspace key, I will prevent user to go back page. But user can press any part of the page, not speficific part. I thought that I can do this operation in body tag. And I wrote this code;
<body onkeyup="blockbackspace(this)">
And there is a javascript function;
function blockbackspace(n){
if (event.keyCode == 8){
????
}
}
As you see above, when user press backpace "if (event.keyCode == 8)" is true. But what should I do rest of this? Altough I wrote this javascript the back page is loaded. How can I prevent?
Firstly, I want to say I am new on javascript.
I want to remove backspace key. I mean that when user presses backspace key, I will prevent user to go back page. But user can press any part of the page, not speficific part. I thought that I can do this operation in body tag. And I wrote this code;
<body onkeyup="blockbackspace(this)">
And there is a javascript function;
function blockbackspace(n){
if (event.keyCode == 8){
????
}
}
As you see above, when user press backpace "if (event.keyCode == 8)" is true. But what should I do rest of this? Altough I wrote this javascript the back page is loaded. How can I prevent?