Created
July 28, 2017 11:52
-
-
Save ikoner/d6310321bd210fcbea18306544062f64 to your computer and use it in GitHub Desktop.
Disable enter on form submit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function disableEnter(e) | |
{ | |
e = e || window.event; | |
var key = e.keyCode || e.charCode; | |
return key !== 13; | |
} | |
<form onkeypress="return disableEnter(event);"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment