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
Works for me:
$('#comment').keypress(function(event) {
if (event.which == 13) {
event.preventDefault();
}
});
http://jsfiddle.net/esEUm/
UPDATE
In case you're trying to prevent the submitting of the parent form rather than a line break (which only makes sense, if you're using a textarea, which you apparently aren't doing?) you might want to check this question: Disable the enter key on a jquery-powered form