Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable enter on form submit
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