title: How to add the "Please Wait" popup when submitting a form in magento
body: <p>I have an admin module in magento. When the form is submitted I want to be able to show the "Please Wait" popup (the same way you get one when making changes to the categories). I am not currently using any AJAX but assume I need to submit the form using ajax. I don't have any phtml files as my form information is set programmatically (as it's dynamic).</p>
  
  <p>Can someone point me in the right direction to use the "Please Wait" in magento, either with or without AJAX?</p>
  
  <p>If you need any more information about how I am displaying the form please let me know as I don't know what information is required and don't want to just fill my post with random snippets.</p>
  
  <p><strong>Resolved</strong></p>
  
  <p>Just for clarity to save going through comments:</p>
  
  <p>I overrode the default save button to add a JS onclick:</p>
  
  <pre><code>$this-&gt;_updateButton('save', 'onclick', 'submitForm()');
  </code></pre>
  
  <p>I then included a JS file using <code>layout.xml</code></p>
  
  <pre><code>&lt;reference name="head"&gt;
      &lt;action method="addJs"&gt;&lt;script&gt;mymodule/javascript.js&lt;/script&gt;&lt;/action&gt;
  &lt;/reference&gt;
  </code></pre>
  
  <p>Then added a JS function:</p>
  
  <pre><code>function submitForm(){
      $('edit_form').request({
           onComplete: function()  { 
               window.location.href = document.URL; 
           }
       })  
  }
  </code></pre>
  
  <p>This sorted it for me.</p>