Reset html form after submitting form and use it again without page refresh
<p>I have html form in PHP page which offers image download in different sizes.</p>

<pre><code>&lt;form action='download.php' method='post'&gt;
     &lt;select name='size'&gt;
          &lt;option value='1'&gt;Small&lt;/option&gt;
          &lt;option value='2'&gt;Medium&lt;/option&gt;
          &lt;option value='3'&gt;Large&lt;/option&gt;
     &lt;/select&gt;
     &lt;button type='submit'&gt;Download&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>And in "download.php" page there is code which generate image and start downloading automatically using header.</p>

<pre><code>header('Content-type: image/jpeg');
header('Content-Disposition: attachment; filename="'.$filename.'"');        
imagejpeg($image, null, 100);
</code></pre>

<p>When I click on download button, form submits successfully and image starts downloading. Because I am using header in download.php file, current page not redirects to download.php file, and form remains as it is. Everything works till now.</p>

<p>Now if I click on download button again, form redirects to download.php file, with no image downloading.</p>

<p>Is there any way to work download button more than one time, without refreshing my index page?</p>

<p><strong>Notes:</strong></p>

<p>1.) I am using jquery on index page.</p>

<p>2.) Instead of <code>&lt;input type='submit' /&gt;</code>, I am using <code>&lt;button type='submit'&gt;&lt;/button&gt;</code> because I am using font-awesome jquery plugin to put icon in button. Which is not possible in input tag.</p>
