title: Pass Value of Text Area Ajax PHP
body: <p>I'm sure this is simple, but new to AJAX so could do with a pointer. I see others have had this issue but can't find a clear answer.</p>
  
  <p>I have a form with a text area</p>
  
  <pre><code>    &lt;form name='comment_form' method="post"&gt;
       &lt;textarea  name='comment' id="comment" value="" cols="100" rows="3"/&gt;&lt;/textarea&gt;
       &lt;input type="button" value="Send" onClick="process_comment();"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I've stripped this down a lot because there is quite a lot in the form.</p>
  
  <p>So in the Function I set the variable:</p>
  
  <pre><code>    var comment=document.getElementById("comment").value
  </code></pre>
  
  <p>And then pass it with ajaxrequest.send like:</p>
  
  <pre><code>    comment="+encodeURIComponent(comment)
  </code></pre>
  
  <p>As part of the string, this works fine for text box's on the form, but the text area gives me a value of:</p>
  
  <pre><code>   [object HTMLTextAreaElement]
  </code></pre>
  
  <p>I'm sure this contains the value of the Text Area, but I can't find out how to display it. I am using PHP:</p>
  
  <pre><code>    $comment = $_POST['comment'];
  </code></pre>
  
  <p>Any pointers would be great.</p>
  
  <h2>Thanks.</h2>
  
  <p>OK it all works with text box's and I use the same method to set the values for example:</p>
  
  <pre><code>    var comment=document.getElementById("comment").value
  </code></pre>
  
  <p>The ajax send is:</p>
  
  <pre><code>      ajaxRequest.send("first_name="+encodeURIComponent(first_name)+"&amp;last_name="+encodeURIComponent(last_name)+"&amp;shipping_company="+encodeURIComponent(shipping_company)+"&amp;shipping_address_1="+encodeURIComponent(shipping_address_1)+"&amp;shipping_address_2="+encodeURIComponent(shipping_address_2)+"&amp;shipping_city="+encodeURIComponent(shipping_city)+"&amp;shipping_postcode="+encodeURIComponent(shipping_postcode)+"&amp;shipping_zone="+encodeURIComponent(shipping_zone)+"&amp;shipping_country="+encodeURIComponent(shipping_country)+"&amp;email="+encodeURIComponent(email)+"&amp;order_id="+encodeURIComponent(order_id)+"&amp;order_status_id="+encodeURIComponent(order_status_id)+"&amp;notify="+encodeURIComponent(notify)+"&amp;comment="+encodeURIComponent(comment)+"&amp;date_added="+encodeURIComponent(date_added));
  </code></pre>
  
  <p>All the other values pass through the post variables fine, but the Text Area just comes up with:</p>
  
  <pre><code>    [object HTMLTextAreaElement]
  </code></pre>