I have a little chat setup, and on enter press if the text area is in focus I have it set to submit the chat to my database and clear the text area. Unfortunately though, the first time one presses enter it adds a linebreak in the text area, in any browser. If you type and press enter again, there's still only one line break there. Am I missing something?Thanks!\[code\] $(document).keypress(function(keyPress) { if (keyPress.which == 13) { if ($('#chatText').is(':focus')) { if ($('#chatText').val().length > 0) { chatValue = http://stackoverflow.com/questions/15825945/$('#chatText').val(); $('#chatText').val($('#chatText').val().substring(0,0)); $.ajax({ type: 'POST', url: 'submitChat.php', data: { chatText: chatValue }, success: function(result) { $('#chat_text').html(result); document.getElementById('chat_text').scrollTop = 9999999; } }); } } } });\[/code\]