I want to send a textarea’s data when user presses shift + enter, but without inserting a new line.
This doesn’t work:
$( 'form textarea' ).keydown(function (event) {
if (event.keyCode == 13 && event.shiftKey) {
send_data();
event.preventDefault();
return false;
}
});
I’m using Google Chrome.
While I was debugging, my send_data function was:
But after I saw Esailija’s comment I realized my code was correct
and the “alert” was the cause of my problem. Stupid question, sorry for that.