I\'ve been trying various methods to get a form to submit when hitting the enter key. I know it works with an input field, but because this is going to be a comment, it nee
I think you would also want to give users ability to go to new line using shift.
$('.messageTextarea').on('keyup', function(e) {
if (e.which == 13 && ! e.shiftKey) {
// your AJAX call
}
});
See this: http://jsfiddle.net/almirsarajcic/Gd8PQ/
It worked for me.
Also, you need to remove that submit button you currently have.