Share this page 

Prevent multiple submitTag(s): Form


 <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