Javascript
Write a JavaScript code that prevents users from submitting a form and then refreshing the page (such as pressing F5 or pressing the refresh button on IE) to resubmit the form's content. The page submission is submitted to this page on this page. Everybody help?
The following code only implements the Mask right mouse button, CTRL + N, SHIFT+F10, F5 refresh, backspace.
function KeyDown () {
Screen the right mouse button, CTRL + N, SHIFT+F10, F5 refresh, backspace key
Alert ("ASCII code is:" +event.keycode);
if ((Window.event.altKey) &&
((window.event.keycode==37) | | Shielding ALT + Direction key ←
(window.event.keycode==39))) {//Shielding ALT + Direction key →
Alert ("You are not allowed to use ALT + arrow keys forward or back page!") ");
Event.returnvalue=false;
}
if ((event.keycode==8) | | Mask BACKSPACE Delete key
(event.keycode==116) | | Mask F5 Refresh Key
(event.keycode==112) | | Mask F1 Refresh Key
(Event.ctrlkey && event.keycode==82)) {//ctrl + R
event.keycode=0;
Event.returnvalue=false;
}
if ((Event.ctrlkey) && (event.keycode==78))//Shield CTRL + N
Event.returnvalue=false;
if ((Event.shiftkey) && (event.keycode==121))//Shielding SHIFT+F10
Event.returnvalue=false;
if (Window.event.srcElement.tagName = "A" && Window.event.shiftKey)
Window.event.returnValue = false; Screen shift plus left mouse button new page open
if ((Window.event.altKey) && (window.event.keycode==115)) {//Shield ALT+F4
Window.showmodelessdialog ("About:blank", "" "," dialogwidth:1px;dialogheight:1px ");
return false;}
}