Hey ..
I have a script that validates the fields and a check box that I need ..
But I also want it to make sure a valid email address is submited ..
I have been trying for ages to merge it into my script .. with no luck ..
I thought a javascript guru maybe able to help me out ..
Here is my script:
[code=php]
<SCRIPT LANGUAGE=”JavaScript”>
function validateForm()
{
formObj = document.cart;
if (formObj.name.value == “”)
{
alert(“You have not entered your name.”);
formObj.name.focus();
return false;
}
else if (formObj.email.value == “”)
{
alert(“You have not entered your email address.”);
formObj.email.focus();
return false;
}
else if (formObj.phone.value == “”)
{
alert(“You have not entered a contact phone number.”);
formObj.phone.focus();
return false;
}
else if (formObj.address.value == “”)
{
alert(“You have not entered your shipping address.”);
formObj.address.focus();
return false;
}
else if (formObj.city.value == “”)
{
alert(“You have not entered the city you live in.”);
formObj.city.focus();
return false;
}
else if (formObj.terms.checked == false)
{
alert(“You have not agreed to our terms and conditions.”);
formObj.terms.focus();
return false;
}
}
</SCRIPT>
Cheers