title: Textarea .val No Line Breaks when Sending Data via Ajax
body: <p>I have seen a ton of articles about how to add line breaks to the .val, but none of them seem to be working for me. I have tried the jQuery recommended workaround:</p>
  
  <pre><code>$.valHooks.textarea = {
    get: function( elem ) {
    return elem.value.replace( /\r?\n/g, "\r\n" );
    }
  };
  </code></pre>
  
  <p>but, no matter what I seem to do, the text still gets smashed together into one line.</p>
  
  <p>Here is my code:</p>
  
  <p>HTML:</p>
  
  <pre><code> &lt;div id="email-info"&gt;
      &lt;div id="email-top-row"&gt;
          &lt;div id="email-subject-container"&gt;
              &lt;label for="email-subject" class="email-labels"&gt;Subject:&lt;/label&gt;
              &lt;input id="email-subject"&gt;&lt;/input&gt;
          &lt;/div&gt;
          &lt;div id="email-from-container"&gt;
              &lt;label for="email-from" class="email-labels"&gt;From:&lt;/label&gt;
              &lt;input id="email-from"&gt;&lt;/input&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div id="email-body-container"&gt;
          &lt;label for="email-body" class="email-body"&gt;Body:&lt;/label&gt;
          &lt;textarea id="email-body"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
      &lt;button id="email" onclick="emailSend()"&gt;Send Email&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>function emailSend() {
   $.valHooks.textarea = {
    get: function( elem ) {
    return elem.value.replace( /\r?\n/g, "\r\n" );
    }
   };
  
   var emailSubject = $('#email-subject').val();
   var emailFrom = $('#email-from').val();
   var emailBody = $('#email-body').val();        
  
   emailURL = emailURL + '&amp;email_subject=' + emailSubject;
   emailURL = emailURL + '&amp;email_from=' + emailFrom;
   emailURL = emailURL + '&amp;email_body=' + emailBody;
  
   $.getJSON(emailURL, function(data) {
      console.log(data);
   });
  }
  </code></pre>
  
  <p>Now, say I add this to the textbox:</p>
  
  <pre><code>test line 1
  
  test line 2
  
  test line 3
  </code></pre>
  
  <p>When I do a console.log of that, it comes out in the console correct with the line breaks, but in the network inspector tab, and on our server, what is sent is <code>test line 1test line 2test line 3</code>.</p>
  
  <p>I am kinda at a loss of how to add in the line breaks to the url. I have seen a lot of stuff about the '\n' but I have never seen that in my url or in my console logs.</p>
  
  <p>Any help would be greatly appreciated. Thank you  very much.</p>