FreeKB - Disable the Enter key on the keyboard
JavaScript - Disable the Enter key on the keyboard

The following code will disable the Enter key on the user's keyboard. One example where this is practical is when data entered into an input field, such as a search engine, is programmed to disable data as the user types. The source of this code comes from

<script type="text/javascript">
function DisableEnterKey(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var node = ( ? : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type==\"text\")) {return false;}
document.onkeypress = DisableEnterKey;


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 260a0 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |