I was looking for a way to do this, got a few scripts, but none of them is working for me.
When I hit enter in my textboxes, it shouldn\'t do anything.
I hav
This works for me.
$('textarea').keypress(function(event) { if (event.keyCode == 13) { event.preventDefault(); } });
jsFiddle.
Your second piece looks like it is designed to capture people pasting in multiple lines. In that case, you should bind it to keyup paste.
keyup paste