How do i force a comment by pressing enter? At the moment when i press enter it builds a new line. I've seen quite a few articles here on SO but I can't seem to figure it out.
Here's what I've tried:
function enterForm(event) {
if(event.keyCode == 13) {
runForm();
}
}
function enterForm(event) {
if(event.keyCode == 13) {
runForm();
}
}
Adding onKeyUp=”enterForm(event)”
in the textarea tag. Didn't work.
I also tried something like this:
$('.cmnt_new').on('keyup', function(e) {
if (e.which == 13 && ! e.shiftKey) {
// your AJAX call
}
});