title: Submit value on pressing Enter in textarea and pressing Shift+Enter should go to next line
body: <p>I want to have a chat box (textarea) where if user press Enter then it should submit the chat, and if user press Shift+Enter then it should enter in a new line.</p>
  
  <p>I tried something but not able to figure out the exact keyup or keydown thing. The code I'm using at the moment is:</p>
  
  <pre><code>$("textarea").keydown(function(e){
      if (e.keyCode == 13 &amp;&amp; !e.shiftKey)
      {
          e.preventDefault();
      }
  }); 
  </code></pre>
  
  <p><a href="http://jsfiddle.net/Su5ts/">jsFiddle</a></p>
  
  <p>Also I want to get the <code>\n</code> in place when Enter+Shift key is pressed.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Issue with my code is:-</p>
  
  <p>When i am check the content on client using using alert then it shows the next line. But when i am posting it my rails back end. Then its just a simple string. No new line thing is there.</p>
  
  <p>This is how i am sending chats to rails server.</p>
  
  <pre><code>  $.post("/incomingchat", { body:$("#chat_" + group_id).val() },
     function(data){
          // do something..
      });
  </code></pre>