- Download Form
function checkFields()
{
var full_name = elt('full-name');
var email = elt('e-mail');
var email_regex =
/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var email_good = email_regex.test(email.value);
if(full_name.value == "" && !email_good) {
full_name.style.backgroundColor = 'red';
email.style.backgroundColor = 'red';
doMessage('
Please Fill-in the Required Fields!
');
return false;
} else if(full_name.value == "") {
full_name.style.backgroundColor = 'red';
doMessage('
Full Name Required!
');
return false;
} else if(!email_good) {
email.style.backgroundColor = 'red';
doMessage('
Please Enter a Valid Email!
');
return false;
}
return true;
}