// <script>// JavaScript Documentfunction formchecker(theForm){// check first nameif (theForm.firstname.value == ""){alert("You must enter a first name.");theForm.firstname.focus();return (false);}// require at least one title to be selectedvar radioSelected = false;for (i = 0;  i < theForm.title.length;  i++){if (theForm.title[i].checked)radioSelected = true;}if (!radioSelected){alert("Please select one of the title options.");return (false);}// check last nameif (theForm.lastname.value == ""){alert("You must enter a last name.");theForm.lastname.focus();return (false);}// check first addressif (theForm.addressone.value == ""){alert("You must enter a address.");theForm.addressone.focus();return (false);}// check city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 zipif (theForm.zip.value == ""){alert("You must enter a zip.");theForm.zip.focus();return (false);}// check home phoneif (theForm.homephone.value == ""){alert("You must enter a daytime phone.");theForm.homephone.focus();return (false);}// require at least 9 characters be entered for home phoneif (theForm.homephone.value.length < 9){alert("Please enter a correct daytime phone, including area code.");theForm.homephone.focus();return (false);}// allow ONLY numbers for home phone// this can be altered for any "checkOK" string you desirevar checkOK = "0123456789";var checkStr = theForm.homephone.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.homephone.focus();return (false);}// require at least preferred contactvar radioSelected = false;for (i = 0;  i < theForm.preferred.length;  i++){if (theForm.preferred[i].checked)radioSelected = true;}if (!radioSelected){alert("Please select one of the preferred contact options.");return (false);}// check emailif (theForm.email.value == ""){alert("Please enter an email address.");theForm.email.focus();return (false);}// check validity of email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);   }// require at least one job opportunity optionvar radioSelected = false;for (i = 0;  i < theForm.jobsavail.length;  i++){if (theForm.jobsavail[i].checked)radioSelected = true;}if (!radioSelected){alert("Please select one of the job opportunity options.");return (false);}// require at least one ideal candidate optionvar radioSelected = false;for (i = 0;  i < theForm.ideal.length;  i++){if (theForm.ideal[i].checked)radioSelected = true;}if (!radioSelected){alert("Please select one of the ideal candidate options.");return (false);}// check start dateif (theForm.startdate.value == ""){alert("Please enter a start date.");theForm.startdate.focus();return (false);}// check start dateif (theForm.contractdetails.value == ""){alert("Please enter your contract details.");theForm.contractdetails.focus();return (false);}// require at least one option of contract flexibiityvar radioSelected = false;for (i = 0;  i < theForm.termsflexible.length;  i++){if (theForm.termsflexible[i].checked)radioSelected = true;}if (!radioSelected){alert("Please select whether or not your contract terms are flexible.");return (false);}}