Created
December 23, 2016 19:32
-
-
Save wwilliams/2ddd340ad7aca43098cd516d5a5278cb to your computer and use it in GitHub Desktop.
stops form submit on return but allows new line on textarea
This file contains 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
$(document).ready(function () { | |
$(window).keydown(function (event) { | |
if (event.keyCode == 13 && event.target.nodeName != 'TEXTAREA') { | |
event.preventDefault(); | |
return false; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment