Advertisement
vincecudz

simmonscomputer - stopper for radio, checkbox and text input

Aug 28th, 2013
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script language=javascript type=text/javascript>
  2. function stopRKey(evt) {
  3.    var evt = (evt) ? evt : ((event) ? event : null);
  4.    var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  5.    if ((evt.keyCode == 13) && (node.type=="text")) {return false;}
  6.    if ((evt.keyCode == 13) && (node.type=="radio")) {return false;}
  7.    if ((evt.keyCode == 13) && (node.type=="checkbox")) {return false;}
  8.    if ((evt.keyCode == 13) && (node.type=="textarea")) {return false;}
  9.    if ((evt.keyCode == 13) && (node.type=="dropdown")) {return false;}
  10. }
  11. document.onkeypress = stopRKey;
  12. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement