Do you ever receive multiple copies of a single form submission? Do your visitors click the submit button over and over, hoping it will hurry up the process? Well, JavaScript can solve your problems! The script will prevent the visitor from submitting the form after the first submission. Basic field validation also included!
Add the below code to the <body> section of your page:
<scriptlanguage="javascript"type="text/javascript"> /* Visit http://www.yaldex.com/
for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin var
submitcount=0;
function
checkFields(){// field validation - if((document.emailform.name.value=="")||// checks if fields are blank. (document.emailform.email.value=="")||// More validation scripts at (document.emailform.comments.value==""))// forms.javascriptsource.com { alert("Please
enter your name, email, and comments then re-submit this form."); returnfalse; }
else { if(submitcount
==0) { submitcount++; returntrue; } else { alert("This
form has already been submitted. Thanks!"); returnfalse; } }
} window.onload=reset; // End --> </script> <formmethod=postaction="http://cgi.feedback.com/mail.pl"name="emailform"onSubmit="return
checkFields()">