title: How to prevent duplicate form submit with browser refresh
body: <p>I use invision power board n i added little plugin for admin control panel. In this plugin is for changes some value in DB i added form. When i submited form all ok, but when i reload all page with F5, the  form submited again.</p>
  
  <p>there is my code </p>
  
  <pre><code>&lt;form method="post" id='xp_form' name='xp_form' enctype="multipart/form-data" action="" style='margin: 5px;'&gt;
                      &lt;label style='font-weight: bold;'&gt;New value&lt;/label&gt;
                      &lt;p style='margin-top: 3px;'&gt;
                          &lt;input size="5" maxlength="7" name="xpValue" value="" tabindex="1" style='width: 98%; border-radius: 7px;'&gt;
                      &lt;/p&gt;
                      &lt;fieldset style='text-align: center;border-top: 1px solid #ccc;margin-top:5px;'&gt;
                          &lt;input value='Cancel' name='xn_value' onclick='closeEdit()' type='button' style='padding: 4px;cursor: pointer;-webkit-border-radius: 4px; border-radius: 4px;border-color: #2b2b2b;'&gt; &amp;nbsp;
                          &lt;input value=' Save ' type='button' onclick='return testPost()' style='padding: 4px;cursor: pointer;-webkit-border-radius: 4px; border-radius: 4px;border-color: #2b2b2b;'&gt;
                          &lt;/fieldset&gt;
                  &lt;/form&gt;
  </code></pre>
  
  <p>and javascript code for form submiting</p>
  
  <pre><code>document.forms["xp_form"].submit(); //first submit
                          document.forms["xp_form"].reset(); //and then reset the form values
  </code></pre>
  
  <p>I can't redirect to the another page or disable submit button. Let me explain. I use cms. For for dashboard i added plugin -><a href="http://ecogis.comyr.com/2013-07-20_1043.png" rel="nofollow">image</a>. When admin selected row and click on the button with pencil icon showing popup window. In this window admin can edit value and then save value and then edit others records</p>