// <script>// JavaScript Documentfunction formchecker(theForm){// check input fieldsif (theForm.firstname.value == ""){alert("You must enter a first name.");theForm.firstname.focus();return (false);}if (theForm.lastname.value == ""){alert("You must enter a last name.");theForm.lastname.focus();return (false);}if (theForm.company.value == ""){alert("You must enter a company name.");theForm.company.focus();return (false);}if (theForm.title.value == ""){alert("You must enter a title.");theForm.title.focus();return (false);}// check day phoneif (theForm.dayphone.value == ""){alert("You must enter a daytime phone.");theForm.dayphone.focus();return (false);}// require at least 9 characters be enteredif (theForm.dayphone.value.length < 9){alert("Please enter a correct daytime phone, including area code.");theForm.dayphone.focus();return (false);}// allow ONLY numbers for evening phone and daytime phone// this can be altered for any "checkOK" string you desirevar checkOK = "0123456789";var checkStr = theForm.dayphone.value;var allValid = true;for (i = 0;  i < checkStr.length;  i++){ch = checkStr.charAt(i);for (j = 0;  j < checkOK.length;  j++)if (ch == checkOK.charAt(j))break;if (j == checkOK.length){allValid = false;break;}}if (!allValid){alert("Please enter only numbers for your daytime phone.");theForm.dayphone.focus();return (false);}// check input fieldsif (theForm.addressone.value == ""){alert("You must enter an address.");theForm.addressone.focus();return (false);}// check validity of email addressif (theForm.email.value.indexOf("@")<3){alert("Your email address seems wrong. Please"+" check the prefix and '@' sign.");return (false);}if ((theForm.email.value.indexOf(".com")<5)&&(theForm.email.value.indexOf(".org")<5)&&(theForm.email.value.indexOf(".gov")<5)&&(theForm.email.value.indexOf(".net")<5)&&(theForm.email.value.indexOf(".mil")<5)&&(theForm.email.value.indexOf(".edu")<5)){alert("Your email seems wrong. Please"+" check the suffix for accuracy. (It should include a "+".com, .edu, .net, .org, .gov or .mil)");return (false);   }// check input fieldsif (theForm.city.value == ""){alert("You must enter a city.");theForm.city.focus();return (false);}// check if no state drop down has been selectedif (theForm.state.selectedIndex <= 0){alert("Please select a state.");theForm.state.focus();return (false);}// check input fieldsif (theForm.zip.value == ""){alert("You must enter a zip.");theForm.zip.focus();return (false);}}