title: submit of form using type button javascript
body: <p>i have a form with an element of type button. I want to use the onclick method to set an image of an img tag, and then simulate the "action" of the form. I tried the following code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function imgtest(){
  document.getElementById
  
  ("test").src="progress.gif";
  
  }
  &lt;/script&gt;
  
  
  &lt;title&gt;Hello&lt;/title&gt;
  &lt;body&gt;
  &lt;form method="POST" action="test.php"&gt;
  &lt;input type="button" value="Submit" 
  
  onclick="imgtest()"&gt;
  &lt;/form&gt;
  &lt;div id="img"&gt;
  &lt;img id="test" src="load.png"&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Though, this does not seem to work. What may be the other solution?</p>