Hi all,
I can’t seem to figure this one out. Any help is appreciated. I want to verify that the first name and the last name are entered, as well as either the email address OR the mailing address. The following code is as good as I could get from online resources, etc:
[CODE]<!–
function Verification() {
if (document.forms[0].FirstName.value == “” || document.forms[0].LastName.value == “”) {
window.alert (“You must enter your first and last name”);
return false;
}
if (document.forms[0].Email.value == “” || (document.forms[0].Street.value == “”
&& document.forms[0].City.value == “” && document.forms[0].State.value == “”
&& document.forms[0].Zip.value == “”)) {
window.alert (“You must enter either your email or mailing address.”);
return false;
}
if (document.forms[0].Email.value != “” || (document.forms[0].Street.value != “”
&& document.forms[0].City.value != “” && document.forms[0].State.value != “”
&& document.forms[0].Zip.value != “”)) {
return true;
}
}
–>
</script>
This code works for first and last name, but requires that both email and the “street” field be populated. I just want it to basically say, “If the email field OR (ALL) of the Address fields are populated, then return true.