Add new line character to textarea instead of submitting form
I have a form with a text area and hitting the enter key submits my form. How can I make it to add a new line character instead of a form submit. Muhammad Talha Akbar $('textarea').keypress(function(event) { if (event.which == 13) { event.stopPropagation(); } }); JSFiddle Demo This should help $('#myProblematicForm textarea').keypress(function(event) { if (event.which == 13) { event.preventDefault(); this.value = this.value + "\n"; } }); For what it's worth, I'm using Chrome on OS X and Enter inserts a \n in a textarea for me and does not submit forms by default. $(document).ready(function(){