function trim(str){ return str.replace(/^\s+|\s+$/g,''); } function frmSubmit_Job(Form) { if(trim(Form.txtName.value)=="") { alert("Please enter the Name"); Form.txtName.focus(); return false; } else if(trim(Form.txtEmail.value)=="") { alert("Please enter the EmailID"); Form.txtEmail.focus(); return false; } else if(isEmail(Form.txtEmail)==false) { Form.txtEmail.focus(); return false; } else if(trim(Form.txtQualification.value)=="") { alert("Please enter the Qualification"); Form.txtQualification.focus(); return false; } else if(trim(Form.intExpYear.value)=="") { alert("Please Enter the Experience") Form.intExpYear.focus(); return false; } else if(IsNumeric(Form.intExpYear.value)==false) { alert("Please Check the Experience") Form.intExpYear.focus(); return false; } /* else if(Form.txtExperience.value.indexOf("-")==-1 || Form.txtExperience.value.indexOf("-")==0){ alert("Please Enter the Experience as Eg: 1-2 yrs") Form.txtExperience.focus(); return false; }*/ else if(trim(Form.txtDescription.value)=="") { alert("Please enter the Description"); Form.txtDescription.focus(); return false; } else if(trim(Form.txtFile.value)=="") { alert("Please select the File"); Form.txtFile.focus(); return false; } else if(trim(Form.txtFile.value)!="") { if(LimitAttach(Form,Form.txtFile.value)==false) { return false; } } } function frmSubmit_Post_Resume(Form) { if(trim(Form.txtPosition.value)=="") { alert("Please enter the Position Applying"); Form.txtPosition.focus(); return false; } else if(trim(Form.txtName.value)=="") { alert("Please enter the Name"); Form.txtName.focus(); return false; } else if(trim(Form.txtEmail.value)=="") { alert("Please enter the EmailID"); Form.txtEmail.focus(); return false; } else if(isEmail(Form.txtEmail)==false) { Form.txtEmail.focus(); return false; } else if(trim(Form.txtQualification.value)=="") { alert("Please enter the Qualification"); Form.txtQualification.focus(); return false; } else if(trim(Form.intExpYear.value)=="") { alert("Please Enter the Experience") Form.intExpYear.focus(); return false; } else if(IsNumeric(Form.intExpYear.value)==false) { alert("Please Check the Experience") Form.intExpYear.focus(); return false; } else if(trim(Form.txtDescription.value)=="") { alert("Please enter the Description"); Form.txtDescription.focus(); return false; } else if(trim(Form.txtFile.value)=="") { alert("Please select the File"); Form.txtFile.focus(); return false; } else if(trim(Form.txtFile.value)!="") { if(LimitAttach(Form,Form.txtFile.value)==false) { return false; }} } function frmSubmit_Employers(Form) { if(trim(Form.txtcompanyname.value)=="") { alert("Please enter the Company Name"); Form.txtcompanyname.focus(); return false; } else if(trim(Form.txtcontactperson.value)=="") { alert("Please enter the Contact Person"); Form.txtcontactperson.focus(); return false; } else if(trim(Form.txtdesignation.value)=="") { alert("Please enter the Designation"); Form.txtdesignation.focus(); return false; } else if(trim(Form.txtaddress1.value)=="") { alert("Please Enter the Address1") Form.txtaddress1.focus(); return false; } else if(trim(Form.txtaddress2.value)=="") { alert("Please Enter the Address2") Form.txtaddress2.focus(); return false; } else if(trim(Form.txtphoneno.value)=="") { alert("Please Enter the PhoneNo") Form.txtphoneno.focus(); return false; } else if(trim(Form.txtemailid.value)=="") { alert("Please enter the EmailID"); Form.txtemailid.focus(); return false; } else if(isEmail(Form.txtemailid)==false) { Form.txtemailid.focus(); return false; } else if(trim(Form.txtphoneno.value)=="") { alert("Please Enter the PhoneNo") Form.txtphoneno.focus(); return false; } else if(trim(Form.txtjobtitle.value)=="") { alert("Please Enter the Job Title") Form.txtjobtitle.focus(); return false; } else if(trim(Form.txtnoofvacancies.value)=="") { alert("Please Enter the No Of Vacancies ") Form.txtnoofvacancies.focus(); return false; } else if(isNaN(Form.txtnoofvacancies.value)) { alert("Please enter the Numberic value") Form.txtnoofvacancies.focus(); return false } else if(trim(Form.txtduties.value)=="") { alert("Please Enter the Duties to be perfomed by candadies") Form.txtduties.focus(); return false; } } function isEmail(objField){ if(objField.value.length > 0){ if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(objField.value)){ return true; } } alert("Invalid E-mail Address! Please re-enter."); objField.select(); return false; } function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function Paging(IntTotal) { var Form = document.forms[0].name; var num = eval(Form+".intPage.value"); if(isNaN(num)) { alert("Please enter the Numberic value") eval(Form+".intPage.focus();") return false; } else if(num > IntTotal) { alert("Please enter within TotalPages") eval(Form+".intPage.focus();") return false; } else if(num==0) { alert("Please enter the valid Page No") eval(Form+".intPage.focus();") return false; } else { var intCurrentPage = eval(Form+".intPage.value") - 1; eval(Form+".startNo.value="+ 10 * intCurrentPage); eval(Form+".method='Get'"); eval(Form+".submit();"); } } extArray = new Array(".doc", ".txt", ".pdf",".rtf"); function LimitAttach(form, file) { allowSubmit = false; if (!file) return; while (file.indexOf("\\") != -1) file = file.slice(file.indexOf("\\") + 1); ext = file.slice(file.indexOf(".")).toLowerCase(); for (var i = 0; i < extArray.length; i++) { if (extArray[i] == ext) { allowSubmit = true; break; } } if (allowSubmit) return true; else alert("Please only upload CV that end in types: " + (extArray.join(" ")) + "\nPlease select a new " + "CV to upload and submit again."); return false; }