title: Form submit using Ajax
body: <p>I need to submit the a form using Ajax with POST method.The code is as follows,</p>
  
  <pre><code>function persistPage(divID,url,method){ 
      var scriptId = "inlineScript_" + divID;
      var xmlRequest = getXMLHttpRequest();   
      xmlRequest.open("POST",url,true);
      xmlRequest.onreadystatechange = function(){
      alert(xmlRequest.readyState + " :" + xmlRequest.status);
      if (xmlRequest.readyState ==4 || xmlRequest.status == 200)
            document.getElementById(divID).innerHTML=xmlRequest.responseText;
      };
      xmlRequest.open("POST", url, false);
      alert(xmlRequest.readyState);
      xmlRequest.send(null);
  }
  </code></pre>
  
  <p>but the form is not submitting(request is not executed or no data posted).How to submit the form using Ajax.</p>
  
  <p>Thanks</p>