title: How to make form submission synchronous?
body: <p>As javascript(including form submission) is synchronous and single thread model except ajax calls. Is that right? But i am facing one issue regarding this. </p>
  
  <p>I am submitting the form at line 1 and then closing the pop up. what happens is self.close get called before form submission.
  So here it is behaving in asynch mode. Is form submission a asynchronous process? If yes how can i make the code after
  form submission synchronous?(I dont want to use setTimeOut and ajax)</p>
  
  <p>Here is my relevant jsp code</p>
  
  <pre><code>function clickSave()
   {
  
      document.form.action="customerAction.do";
      document.form.submit();// line 1
      self.close();// line 2
  
   }
  </code></pre>
  
  <p><strong>Update</strong>:- Looks like i need to correct myself form submission is asynchronous process as per <a href="https://stackoverflow.com/questions/7985930/is-form-submit-synchronous-or-async">Is form submit synchronous or async?</a>. So question is how can i make self.close synchronous with form submission</p>