| free hosting image hosting hosting reseller online album e-shop famous people | ||
![]() ![]() |
||
ensures that the form can only be submitted once
checks that all fields are filled in
submits the form to a CGI mailform handler
resets the form when the page is loaded
Add this section inside your body tag with your other body requirements:
And this section in the body itself:
if (document.emailform.name.value=="")You are then returned to the form to fill in the missing field.
{
alert("Please enter your name");
return false;
}
var submitcount=0;When the submit button is clicked, if submitcount==0, the form is submitted:
if (submitcount == 0)The return true line allows the form to be transmitted.
{
submitcount++;
return true;
}
alert("This form has already been submitted. Thanks!");The return false line prevents the form from being re-submitted.
return false;
<input type=hidden name=to value="you@your-website-address-here.com">These are for the the CGI mail program - in this example, mail.pl.
<input type=hidden name=subject value="Feedback Form">