title: Display image when submit button is pressed
body: <p>I have a multi-page form that was created for me. All of the pages on the form have submit button that saves the data to a database, a previous button that goes to the previous page and a next button. How do I display an image when the save button (id="save") is pressed? Right now the image pops up when either one of the buttons are pressed. I am a jQuery rookie so any help is greatly appreciated. Thanks!  </p>
  
  <p>The jQuery</p>
  
  <pre><code>&lt;script&gt;
  jQuery(document).ready(function($) {
    $('form').submit(function (e) {
     var form = this;
     e.preventDefault();
     setTimeout(function () {
      form.submit();
    }, 5000); // in milliseconds
  
    $("&lt;img src='/wp-content/uploads/2013/04/saving.gif'&gt;").appendTo("#target");
     });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>The PHP</p>
  
  <pre><code>&lt;div id="target"&gt;&lt;/div&gt;
  &lt;input type="submit" name="status" value="Prev" /&gt;
  &lt;input type="submit" name="status" id="save" value="Save" /&gt;
  &lt;input type="submit" name="status" value="Next" /&gt;
  
  &lt;?php
  
  if(!empty($_REQUEST['status']) &amp;&amp; $_REQUEST['status'] == 'Prev'){
    //save data and redirect to previous page using header();
  }
  
  if(!empty($_REQUEST['status']) &amp;&amp; $_REQUEST['status'] == 'Next'){
    //save data and redirect to next page using header();
  }
  
  if(!empty($_REQUEST['status']) &amp;&amp; $_REQUEST['status'] == 'Save'){
    //save data and do whatever you want
  }
  
  
  ?&gt;
  </code></pre>