﻿function checkWholeForm(flow_app){var why="";why+=checkEmail(flow_app.eml.value);why+=isEmpty1(flow_app._name.value);why+=isEmpty2(flow_app.comp.value);why+=isEmpty3(flow_app.add.value);why+=isEmpty4(flow_app.city.value);why+=isEmpty5(flow_app.state.value);why+=isEmpty6(flow_app.zip.value);why+=isEmpty7(flow_app.country.value);why+=isEmpty8(flow_app.ph.value);if (why !=""){alert(why);return false;}
return true;}
function isEmpty1(strng){var error="";if (strng.length==0){error="You did not enter your name.\n"
}
return error;}
function isEmpty2(strng){var error="";if (strng.length==0){error="You did not enter your company name.\n"
}
return error;}
function isEmpty3(strng){var error="";if (strng.length==0){error="You did not enter your address.\n"
}
return error;}
function isEmpty4(strng){var error="";if (strng.length==0){error="You did not enter an city.\n"
}
return error;}
function isEmpty5(strng){var error="";if (strng.length==0){error="You did not enter your state.\n"
}
return error;}
function isEmpty6(strng){var error="";if (strng.length==0){error="You did not enter your zip.\n"
}
return error;}
function isEmpty7(strng){var error="";if (strng.length==0){error="You did not enter your country.\n"
}
return error;}
function isEmpty8(strng){var error="";if (strng.length==0){error="You did not enter your phone number.\n"
}
return error;}
function checkEmail (strng){var error="";if (strng==""){error="Please enter a email address.\n";}
var emailFilter=/^.+@.+\..{2,3}$/;if (!(emailFilter.test(strng))){error="Please enter a valid email address.\n";}
else{var illegalChars=/[\(\)\<\>\,\;\:\\\"\[\]]/
if (strng.match(illegalChars)){error="This is not a true email address.\n";}}
return error;}
