Disable the Enter Key in Form


/ Published in: JavaScript
Save to your folder(s)

added to the head section of the page


Copy this code and paste it in your HTML
  1. function kH(e) {
  2. var pK = e ? e.which : window.event.keyCode;
  3. return pK != 13;
  4. }
  5. document.onkeypress = kH;
  6. if (document.layers) document.captureEvents(Event.KEYPRESS);

URL: http://www.felgall.com/jstip43.htm

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.