title: How to solve [object Object] error in jquery.ajax()
body: <p>I'm using the below jquery function to send data from a form and get the reply back. Below is the Jquery function I use to get the result :</p>
  
  <pre><code>$(document).ready(function(){
      console.log( "ready!" );
      $("#button").click(function(){
          console.log("ready2");
          $.ajax({
              statusCode: {
                  500: function() {
                      alert("error");
                  }
              },
              url: './contact.php',
              type: "POST",
              data: {
                  "name": $("#name").val(),
                  "element_4_1": $("#element_4_1").val(),
                  "element_4_2": $("#element_4_2").val(),
                  "element_4_3": $("#element_4_3").val(),
                  "email": $("#email").val(),
                  "input4": $("#input4").val(),
              },
              error: function(t){
                  console.log("Error: "+t);
              },
              success: function(data){
                  $("#stage").text("Thank You");
              }
          });
      });
  });  
  </code></pre>
  
  <p>Now The text form which is here sends the data :</p>
  
  <pre><code>&lt;div class="col-lg-7 well"&gt;
      &lt;h4 style="padding-top:8px;"&gt;Your email address will not be published. Required fields are marked &lt;font color="red"&gt;*&lt;/font&gt;&lt;/h4&gt;
      &lt;label&gt;Name&lt;font color="red"&gt;*&lt;/font&gt;&lt;/label&gt;&lt;br&gt;
      &lt;input class="form-control" style="height:35px;width:230px;border-radius:4px;" required type="text" name="name"/&gt;&lt;br&gt;
      &lt;label&gt;Phone&lt;font color="red"&gt;*&lt;/font&gt;&lt;/label&gt;&lt;br&gt;
      &lt;span&gt;
          &lt;input id="element_4_1" name="element_4_1" class="element text" size="3" maxlength="3" value=""  type="text"&gt; -
      &lt;/span&gt;
      &lt;span&gt;
          &lt;input id="element_4_2" name="element_4_2" class="element text" size="4" maxlength="4" value="" type="text"&gt; -
      &lt;/span&gt;
      &lt;span&gt;
          &lt;input id="element_4_3" name="element_4_3" class="element text" size="10" maxlength="10" value=""  type="text" required &gt;
      &lt;/span&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;label&gt;Email&lt;font color="red"&gt;*&lt;/font&gt;&lt;/label&gt;&lt;br&gt;
      &lt;input id="email" class="form-control" style="height:35px;width:230px;border-radius:4px;" required type="email" name="text"/&gt;&lt;br&gt;
      &lt;label for="input4"&gt;Message&lt;/label&gt;
      &lt;textarea name="contact_message" class="form-control" rows="4" id="input4"&gt;&lt;/textarea&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;button type="submit" style="margin-left:65px;"class="btn btn-large btn-info" id="button"&gt;Submit&lt;/button&gt;   
  &lt;/div&gt;
  </code></pre>
  
  <p>And the contact.php which I call is like this :</p>
  
  <pre><code>&lt;?php
  if( $_REQUEST[name] &amp;&amp;
      $_REQUEST[element_4_1] &amp;&amp;
      $_REQUEST[element_4_2] &amp;&amp;
      $_REQUEST[element_4_3] &amp;&amp;
      $_REQUEST[email] &amp;&amp;
      $_REQUEST[message]){
     echo " Thank You ";
  }
  ?&gt; 
  </code></pre>
  
  <p>I get this error when I call the function : <code>jquery:-[object Object] error</code>. How can I call this.</p>