Try this (note that pressing Enter submits, and Shift+Enter adds a new line).
$("#textareaId").keypress(function (e) {
if(e.which === 13 && !e.shiftKey) {
e.preventDefault();
$(this).closest("form").submit();
}
});
Try this (note that pressing Enter submits, and Shift+Enter adds a new line).
$("#textareaId").keypress(function (e) {
if(e.which === 13 && !e.shiftKey) {
e.preventDefault();
$(this).closest("form").submit();
}
});