Pages

About Me

My photo
ForEach(Minute in MyLife) MyExperience ++;
Showing posts with label disable. Show all posts
Showing posts with label disable. Show all posts

Thursday, July 28, 2011

Disable back key in browser

Add this script inside head tag in html page 

<script type = "text/javascript" >
   function preventBack(){window.history.forward();}
    setTimeout("preventBack()", 0);
    window.onunload=function(){null};
</script

Wednesday, July 27, 2011

Disable Enter Key

<script language=javascript type=text/javascript>

function stopRKey(evt) {
   var evt = (evt) ? evt : ((event) ? event : null);
   var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
   if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
}

document.onkeypress = stopRKey;

</script>