// 3D PHP File Form-Mailer Check Form JavaScript Document

// This is an open-source form validation script. Form validation is called by the form tag onSubmit="return cf()" when the form is submitted. If everything checks out, the sendform.php gets called. You can use any form validation (e.g. strict or non-strict - this one is non-strict) or no validation at all. I use this non-strict code for my form-mailer with a semi-strict customer number line added. These comments can of course be deleted upon use.

function cf(){
if(document.mailform.CompanyName.value.length==0){alert('Please enter the name of your company.');
document.mailform.CompanyName.focus();return false}
if(document.mailform.ContactName.value.length==0){alert('Please enter your full name.');
document.mailform.ContactName.focus();return false}
if(document.mailform.Email.value.length==0){alert('Please enter a valid email address.');
document.mailform.Email.focus();return false}
if(document.mailform.Telephone.value.length==0){alert('Please enter your telephone number.');
document.mailform.Telephone.focus();return false}
}