A Validation Script ensures your forms are filled out correctly. With Javascript, you can require your visitors to fill in areas of the form. Try the form on the right. It doesn't send mail anywhere, so try it all you like. It requires you to fill in name and email address. |
This code goes between the <HEAD> and the </HEAD> tags in your page:
And this RED code must go in your existing form tag:
<script>
<!--
// E-mail Form - Validator
// Bravenet Web Services - www.bravenet.com
function checkData()
{
var correct = true
if (document.Bravenet.name.value == "") {correct = false; alert("Please enter your name!")}
if (document.Bravenet.replyemail.value == "") {correct = false; alert("Please enter your e-mail address.")}
/*
You can add more variables above.
The name after the word Bravenet has to match the name in the form below.
*/
if (correct){alert("Thank you for taking your time to fill out this form.")}
return correct
}
//-->
</script>
<FORM onSubmit="return checkData()" NAME="Bravenet" action="http://www.bravenet.com/emailfwd/senddata.asp" method="POST">