I have:
$('#myTextArea').keyup(function(e) {
if(e.keyCode == 13) {
e.preventDefault(); // Makes no difference
$(this).parent().submit(); // Submit form it belongs to
}
});
How do I prevent the newline that shows up right before form submission? preventDefault()
and stopPropagation
don't work. I could manually reset the field text, but...