var missing= ""; var gotofld = ""; var j = 0; function checkemail(fld,retmsg){ if(fld.type == "hidden"){return ""} if(fld.value == "") { if (missing == "") {gotofld=fld} return retmsg; } else { if(fld.value.search( "@")==-1) { if (missing == "") {gotofld=fld} return "All email addresses must contain an @ \n"; } } return ""; } // end checkemail function saveasdraft(form) { missing = ""; gotofld = ""; missing += checkval(form.regfname, "First Name \n"); missing += checkval(form.reglname,"Last Name \n"); missing += checkemail(form.busemail,"Email Address \n"); if (missing == "") {return true; } else {missing = "The following fields must be completed before you can save as a draft:\n\n" + missing alert (missing); gotofld.focus(); return false; } } // end saveasdraft // ----------------------------------------------------------------------------------------------------------- function submitnom(form) { missing = ""; gotofld = ""; missing += checkval(form.regfname, "Student's First Name \n"); missing += checkval(form.reglname , "Student's Last Name \n"); missing += checkemail(form.busemail,"Student's email address \n"); missing += checkval(form.birthdate,"Student's Birthdate \n"); missing += checkval(form.HomPhone,"Home Phone Number \n"); missing += checkval(form.HomCellPhone,"Cell Number \n"); missing += checkval(form.HomAddress1,"Street Address \n"); missing += checkval(form.HomCity,"City \n"); missing += checksel(form.HomState,"State \n"); missing += checkval(form.HomPostalCode,"Zip Code \n"); missing += checkval(form.highschool,"High School \n"); missing += checkval(form.gpa,"GPA \n"); missing += checkval(form.selectioncriteria,"Selection Criteria \n"); if( countWordsValid(form.selectioncriteria.value) > 250 ) { if(missing=="") {gotofld = form.selectioncriteria;} missing+="'Selection Criteria' should have 250 words or less \n"; } missing += checkval(form.financialneeda,"Financial Needs (part a) \n"); missing += checkval(form.financialneedb,"Financial Needs (part b) \n"); missing += checkval(form.athleticaccomplishments,"Athletic Accomplishments \n"); missing += checkval(form.communityserviceaffiliations,"Community Service Affliliations \n"); missing += checkval(form.collegesappliedto,"Colleges Applied to \n"); missing += checkval(form.collegesacceptedat,"Colleges Accepted at \n"); missing += checkval(form.collegeplantoattend,"Where to you plan to go to college \n"); missing += checkval(form.areaofstudy,"Area of Study \n"); missing += checkval(form.signature,"Signature \n"); missing += checkval(form.howdidyouhear,"How did you hear about the BCCC Scholarship \n"); if (missing == "") {return true; } else {missing = "The following fields must be completed before you can submit this nomination:\n\n" + missing alert (missing); gotofld.focus(); return false; } } // end submitnom // ----------------------------------------------------------------------------------------------------------- function chkaltapprover(form) { missing = ""; gotofld = ""; missing += checkval(form.altapprover,"Alternate Approver \n"); missing += checkemail(form.altapprover_email,"Alternate Approver's email address \n"); missing += checkval(form.altapprover_phone, "Alternate Approver's Phone Number \n"); if (missing == "") {return true; } else {missing = "The following fields must be completed before you can proceed:\n\n" + missing alert (missing); gotofld.focus(); return false; } } // end chkaltapprover // ----------------------------------------------------------------------------------------------------------- function sendemailalerttoapproverbut() { var keepgoing="No"; if(document.forms[0].whichmanager[1].checked) { if(chkaltapprover(document.forms[0])) {keepgoing="Yes";} } else { if(document.forms[0].whichmanager[0].checked) {keepgoing="Yes";} else {alert("Please indicate to whom this nomination should be sent"); document.forms[0].whichmanager[0].focus() } } if(keepgoing=="Yes") { return true; } else { return false; } }