Jump to Real's How-to Main page

Prevent multiple submit

 <script>
 var submitDone = false;
 
 function submitForm(myForm, button) {
   
      if (!submitDone) {
         submitDone = true;
         button.value = 'Please Wait';
         button.disabled = true;
         myForm.submit();
      } 
      else {
        alert ("Already submitted, please wait!");
      }
   return true;
 }
 </script>
 
 <form name="longsubmit" 
       action="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo">
   Impossible to submit multiple times
     <input type="button" value="Go" 
     onClick="return submitForm(document.longsubmit, this)">
</FORM>
try it :

Impossible to submit multiple times

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]