Been banging my head against the wall, can't figure this one out...
I've got a simple form, just trying to validate certain required fields before submission. It worked fine until I started checking one of the fields against a regex... Now it just gives me object expected errors. Any advice would be very much appreciated:
function appVerify() {
var einFlag = false;
einFlag = /^[0-9]{9}$/.test(document.myform.fiscal_legalTaxID.value);
if(document.myform.fiscal_legalName.value=="" ||
document.myform.fiscal_legalTaxID.value=="" ||
!document.myform.fiscal_projectCategory.selectedIndex ||
document.myform.fiscal_projectDescription.value=="" ||
document.myform.fiscal_qualifications.value=="" ||
document.myform.fiscal_contactChecks.value=="" ||
document.myform.fiscal_contactReceipts.value=="") {
alert("Please fill in all required fields.");
return false;
} elseif(!einFlag) {
alert("Please enter a valid EIN without hyphens.");
return false;
} else {
document.myform.submit();
}
}
</script>
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
I've got a simple form, just trying to validate certain required fields before submission. It worked fine until I started checking one of the fields against a regex... Now it just gives me object expected errors. Any advice would be very much appreciated:
Code:
<script language="javascript" type="text/javascript"> function appVerify() {
var einFlag = false;
einFlag = /^[0-9]{9}$/.test(document.myform.fiscal_legalTaxID.value);
if(document.myform.fiscal_legalName.value=="" ||
document.myform.fiscal_legalTaxID.value=="" ||
!document.myform.fiscal_projectCategory.selectedIndex ||
document.myform.fiscal_projectDescription.value=="" ||
document.myform.fiscal_qualifications.value=="" ||
document.myform.fiscal_contactChecks.value=="" ||
document.myform.fiscal_contactReceipts.value=="") {
alert("Please fill in all required fields.");
return false;
} elseif(!einFlag) {
alert("Please enter a valid EIN without hyphens.");
return false;
} else {
document.myform.submit();
}
}
</script>
Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund