function Validate_Customer_Preferences(theForm,directSubmit){ if(page=="Comparable_Criteria"){ if(directSubmit.length > 0 && directSubmit == 'yes'){ if(validateCompsAll(theForm)){ if(validateCompsCommercial(theForm)){ return true }else{ return false; } }else{ return false; } }else{ if(document.getElementById("prefcomps_tab_all").checked){ return validateCompsAll(theForm); } else if(document.getElementById("prefcomps_tab_commercial").checked){ return validateCompsCommercial(theForm); } } } else{ //The following regular expressions test for empty string or what their name is var alphaNumeric = /^[0-9a-zA-Z]*$/ var alpha = /^[a-zA-Z]*$/ var alphaNumericWithDash = /^[-0-9a-zA-Z]*$/ var numeric = /^[0-9]*$/ var date = /^(\d{2}\/\d{4})*$/ //MM/YYYY var numericWithDecimal = /^(\d)*\.?\d*$/ var zip = /^(\d{5})*$/ //5 digit zip var phone = /^(\d{3}\-\d{3}\-\d{4})*$/ //xxx-xxx-xxxx var ssn = /^(\d{3}\-\d{2}\-\d{4})*$/ //xxx-xx-xxxx // comps - All from to fields validations start here if(document.getElementById("prefcomps_tab_all").checked){ return validateCompsAll(theForm); } // comps - All from to fields validations end here // comps - commercial from to fields validations start here if(document.getElementById("prefcomps_tab_commercial").checked){ return validateCompsCommercial(theForm); } // comps - commercial from to fields validations end here // subject GLA if (typeof(theForm.SUBJ_GLA)!="undefined") { if ((theForm.SUBJ_GLA.value.length>0 && !numeric.test(theForm.SUBJ_GLA.value.replace(",","")))){ alert("Please enter a number for the 'Subject Living Area'."); theForm.SUBJ_GLA.focus(); return false; } } } return true; } function enableSubReportOptions() { var subReportElementNames = new Array("streetmaptype","valuationtype","docimgtype","avmcascadetype","loansafetype","liensuitetype"); for (var i = 0; i < subReportElementNames.length; i++) { toggleCheckBoxes(false,subReportElementNames[i]); } } function validateSubReportOptions(reportOptionName) { var compObj = document.getElementsByName(reportOptionName); var isChecked = false; for (i = 0; i < compObj.length; i++) { if (compObj[i].checked) { isChecked = true; } } return isChecked; } function Validate_Comparable_Criteria(form){return Validate_Customer_Preferences(form);} function Validate_ReportOption(form){ if ("consumer"!=client&&page!="Consumer_Subjects_Search"&&page!="Document_Number_Search"&&page!="Custom_Search"&&page!="Foreclosure_Search"){ try{ if((null!=form.detailproperty && !form.detailproperty.checked) && (null!=form.comparableproperty && !form.comparableproperty.checked) && (null!=form.streetmap && !form.streetmap.checked) && (null!=form.liensuite && !form.liensuite.checked) && (null!=form.transaction && !form.transaction.checked) && (null!=form.voluntarylien && !form.voluntarylien.checked) && (null!=form.involuntarylien && !form.involuntarylien.checked) && /*(null!=form.totallien && !form.totallien.checked) &&*/ (null!=form.assessormap && !form.assessormap.checked) && (null!=form.floodmap && !form.floodmap.checked) && (null!=form.documentimage && !form.documentimage.checked) && (null!=form.legalvesting && !form.legalvesting.checked) && (null!=form.neighborhoodinformation && !form.neighborhoodinformation.checked) && (null!=form.foreclosureactivity && !form.foreclosureactivity.checked) && (null!=form.vector && !form.vector.checked) && (null!=form.valuation && !form.valuation.checked) && (null!=form.loansafe && !form.loansafe.checked) && (null!=form.trueltv && !form.trueltv.checked) && (null!=form.historypro && !form.historypro.checked) && (null!=form.prequalpro && !form.prequalpro.checked) && (null!=form.homestanding && !form.homestanding.checked) && (null!=form.barreport && !form.barreport.checked) && (null!=form.aarreport && !form.aarreport.checked) && (null!=form.lamar && !form.lamar.checked) && (null!=form.ownerconnect && !form.ownerconnect.checked) && (null!=form.historyproreview && !form.historyproreview.checked) && (null!=form.incomepro && !form.incomepro.checked) && //(null!=form.loaniq && !form.loaniq.checked) && -- remove LoanIQ report (null!=form.homevaluecalibrator && !form.homevaluecalibrator.checked)&&(null!=form.willcap && !form.willcap.checked)) //(null!=form.safecheck && !form.safecheck.checked) -- remove SafeCheck report { alert("Please select a Report Option."); return false; } //Added for the validating LienSuite report options while submitting the request if((null!=form.liensuite && form.liensuite.checked) && !validateLienSuiteReportOptions()) { showSubReportErrorMsg("Lien360 Suite Reports"); return false; } if((null!=form.neighborhoodinformation && form.neighborhoodinformation.checked) && !validateNeighborhoodReportOptions()) { showSubReportErrorMsg("Neighborhood Reports"); return false; } //Added for validating AVM Cascade options while submitting the request if ((null != form.vector && form.vector.checked) && !validateAVMCascadeOptions()) { if (guserstatus != 'ENDUSER') { alert("Please select at least one of the AVM Cascade Report from the Report Options list. To retain the changes please save it from 'My Preferences'."); } else { alert("AVM Cascade Report option is not set. Please contact your administrator to request it"); } return false; } // check RefID if (null!=form.st_jobid){ if (!checkCharacter(form.st_jobid)){ return false; } } }catch(ex){return false;} if (page=="Property_List"){ DWRController.setPurchasePDataValue("hide"); } return true; } return true; } /* To check neighborhood subreport checkbox status */ function Validate_availableReport(url) { //var neighborhoodReportOptionId = '262144'; //commented as unique report id has changed var neighborhoodReportOptionId = '5c5fc23f-f445-4f48-af36-7d536c8c4ab4'; var lienSuiteReportOptionId = 'e091a448-c028-4b34-8d37-a13a9bdd001c'; var avmSuiteReportOptionId = '3f04c528-6feb-4f55-9b22-f0db5dad3e82'; try { var reportOptionValue = getURLParam('reportoptions', url); if ((reportOptionValue == lienSuiteReportOptionId) && !validateLienSuiteReportOptions()) { showSubReportErrorMsg("Lien360 Suite Reports"); return false; } if ((reportOptionValue == neighborhoodReportOptionId) && !validateNeighborhoodReportOptions()) { showSubReportErrorMsg("Neighborhood Reports"); return false; } if ((reportOptionValue == avmSuiteReportOptionId) && !validateAVMCascadeOptions()) { if (guserstatus != 'ENDUSER') { alert("Please select at least one of the AVM Cascade Report from the Report Options list. To retain the changes please save it from 'My Preferences'."); } else { alert("AVM Cascade Report option is not set. Please contact your administrator to request it"); } return false; } } catch(err) { return true; } return true; } function validateNeighborhoodReportOptions() { var isChecked = true; var elementObj = isObjExist(document.forms[0].ni_demographics) && isObjExist(document.forms[0].ni_school) && isObjExist(document.forms[0].ni_localbusiness) && isObjExist(document.forms[0].ni_crime); if (elementObj && !document.forms[0].ni_demographics.checked && !document.forms[0].ni_school.checked && !document.forms[0].ni_localbusiness.checked && !document.forms[0].ni_crime.checked) { isChecked = false; } return isChecked; } function validateLienSuiteReportOptions() { var isChecked = true; var elementObj = isObjExist(document.forms[0].transaction) && isObjExist(document.forms[0].legalvesting) && isObjExist(document.forms[0].voluntarylien) && isObjExist(document.forms[0].involuntarylien); if (elementObj && !document.forms[0].transaction.checked &&!document.forms[0].legalvesting.checked &&!document.forms[0].voluntarylien.checked&&!document.forms[0].involuntarylien.checked) { isChecked = false; } return isChecked; } function validateAVMCascadeOptions() { var isChecked = false; if (isObjExist(document.getElementsByName("avmcascadetype"))) { var avmType = document.getElementsByName("avmcascadetype"); for (var i = 0; i < avmType.length; i++) { if (avmType[i].checked) { isChecked = true; break; } } } if (!isChecked) { return false; } else { return true; } } function showSubReportErrorMsg(reportName) { alert("Please select at least one of the "+reportName+" from the Report Options list."); } function Validate_ValuationDate(form){ str = form.valuationdate.value; index = str.lastIndexOf("/"); var year = str.substr(index+1,4); var date = str.substr(3,2); var month = str.substr(0,2); if (year < 1985){alert("Valuation date must be after 01/01/1985.");return false;} var gyear = gvaluationdate.substr(index+1,4); var gmonth = gvaluationdate.substr(0,2); var gdate = gvaluationdate.substr(3,2); if (year > gyear){alert("Valuation date cannot be after today's date.("+str+")");return false;} else if (year == gyear){ if (month > gmonth){alert("Valuation date cannot be after today's date.("+str+")");return false;} else if (month == gmonth){if (date > gdate){alert("Valuation date cannot be after today's date.("+str+")");return false;}} } return true; } function Validate_CoreValuationDate(form){ str = form.corevaluationdate.value; index = str.lastIndexOf("/"); var year = str.substr(index+1,4); var date = str.substr(3,2); var month = str.substr(0,2); if (year < 1985){alert("Valuation date must be after 01/01/1985.");return false;} var gyear = gcorevaluationdate.substr(index+1,4); var gmonth = gcorevaluationdate.substr(0,2); var gdate = gcorevaluationdate.substr(3,2); if (year > gyear){alert("Valuation date cannot be after today's date.("+str+")");return false;} else if (year == gyear){ if (month > gmonth){alert("Valuation date cannot be after today's date.("+str+")");return false;} else if (month == gmonth){if (date > gdate){alert("Valuation date cannot be after today's date.("+str+")");return false;}} } return true; } function Validate_RetroValueDateLoanIQ(form){ var msg = "Retro valuation date cannot be in the future."; var str = form.loaniq_valuationdate.value; var index = str.lastIndexOf("/"); var year = str.substr(index+1,4); var date = str.substr(3,2); var month = str.substr(0,2); var gyear = gvaluationdate.substr(index+1,4); var gmonth = gvaluationdate.substr(0,2); var gdate = gvaluationdate.substr(3,2); if (year > gyear){alert(msg);return false;} if (year > gyear){ alert(msg); return false; }else if (year == gyear){ if (month > gmonth){ alert(msg); return false; }else if (month == gmonth){ if (date > gdate){ alert(msg); return false; } } } return true; } function Validate_RetroValueDateCASA(form){ var msg = "Retro valuation date cannot be in the future."; var str = form.cas_valueationdate.value; var index = str.lastIndexOf("/"); var year = str.substr(index+1,4); var month = str.substr(0,2); var gyear = gvaluationdate.substr(gvaluationdate.lastIndexOf("/")+1,4); var gmonth = gvaluationdate.substr(0,2); var gdate = gvaluationdate.substr(3,2); //As input field does not capture date from the user.Hence considered as current date. var date = gdate; if (year > gyear){ alert(msg); return false; }else if (year == gyear){ if (month > gmonth){ alert(msg); return false; }else if (month == gmonth){ if (date > gdate){ alert(msg); return false; } } } return true; } function Validate_HPIStandalone(form){ if (!form.saledate.value.length){alert("Please enter a Sale Date (must be after 1980).");form.saledate.focus();return false;} str = form.saledate.value; index = str.lastIndexOf("/"); var year = str.substr(index+1,4); if (year < 1980){alert("Please enter a Sale Date (must be after 1980).");form.saledate.focus();return false;} if ((!form.saleprice.value.length) || (form.saleprice.value < 10000)){ alert("Please enter a Sale Price (must be greater than 10000).", form.saledate.value.substring(0,3)); form.saleprice.focus();return false;} } function Validate_main(form){ if (!form.username.value.length){alert("Please enter a username.");form.username.focus();return false;} if (!form.password.value.length){alert("Please enter a password.");form.password.focus();return false;} SetCookie("rqusr", form.remember.checked ? form.username.value : ""); showHide('open','Processing'); } function Validate_Search_Form(form,e){ if (null!=form.searchpagesubmit){form.searchpagesubmit.value=page;} if(page=="Input"){ if ("incomepro"==form.inputform.value){ return validateInpSubmit(); }else if ("loansafe"==form.inputform.value){ return validateLS2Submit(); }else if ("loansafeFraud"==form.inputform.value){ return validateLsFraudSubmit(); }else if ("loansafeCollateral"==form.inputform.value){ return validateLSColltralSubmit(); }else if ("loansafeRisk"==form.inputform.value){ return validateLsRiskSubmit(); }else if ("historypro"==form.inputform.value){ return validateHPSubmit(); }else if ("prequalpro"==form.inputform.value){ return validatePQPSubmit(); }else if ("homestanding"==form.inputform.value){ return validateCoreScoreSubmit(); }else if ("barreport"==form.inputform.value){ return validateBarReportSubmit(); }else if ("aarreport"==form.inputform.value){ return validateAarReportSubmit(); }else if ("historyproreview"==form.inputform.value){ return validateHPRSubmit(); } else if ("willcap"==form.inputform.value){ return validateWillCapReportSubmit(); /* -- remove SafeCheck report }else if ("safecheck"==form.inputform.value){ return validateSafecheckSubmit(form); */ /* -- remove LoanIQ report }else if ("loaniq"==form.inputform.value ){ return validateLoanIQSubmit(form); */ }else if ("hvc"==form.inputform.value){ return validateHVCSubmit(form); }else if ("ownerconnect"==form.inputform.value){ return validateOwnerConnectSubmit(); }/*else if ("totallien"==form.inputform.value){ return validateTotalLienSubmit(); }*/else if ("lamar"==form.inputform.value){ return validateLamarSubmit(); }else if ("involuntarylien"==form.inputform.value){ return validateLien360Submit(); } return true; } var calledFrom ='validateFormSubmit'; if (page=="Parcel_Map_Search"){ if(!Validate_Search_Field(form,calledFrom)) return false; sendMapselect(); return false; } if (page.indexOf("Search")!=-1){ if (Validate_ReportOption(form)){ if(!Validate_Search_Field(form,calledFrom)) {return false;} }else{return false;} }else{ if (page=="Find_Property"){return true;} else if (page=="main"){ if (!form.username.value.length){alert("Please enter a username.");form.username.focus();return false;} if (!form.password.value.length){alert("Please enter a password.");form.password.focus();return false;} SetCookie("rqusr", form.remember.checked ? form.username.value : ""); }else if (page=="relogin"){ if (!document.forms[0].password.value.length){alert("Please enter a password.");document.forms[0].password.focus();return false;} }else if (page=="AVMAnalyticsArchive"){ if (!form.avmana_reporttype.value.length){alert("Please select report type."); form.avmana_reporttype.focus(); return false;} if (form.avmana_dateprocessedfrom.value.length>0){if (!checkDateFormat(form.avmana_dateprocessedfrom.value,"MM/DD/YYYY")){form.avmana_dateprocessedfrom.value="";form.avmana_dateprocessedfrom.focus();return false;}} if (form.avmana_dateprocessedto.value.length>0){if (!checkDateFormat(form.avmana_dateprocessedto.value,"MM/DD/YYYY")){form.avmana_dateprocessedto.value="";form.avmana_dateprocessedto.focus();return false;}} if(avmAnalyticsArchiveValidation(form,form.avmana_reporttype.value)){alert("You must enter at least one search criteria.");return false;} if ( form.avmana_dateprocessedfrom.value.length > 0 && form.avmana_dateprocessedto.value.length > 0) { var fromdate = new Date(form.avmana_dateprocessedfrom.value); var todate = new Date(form.avmana_dateprocessedto.value); if(todate < fromdate){ alert("The 'From' value must be less than or equal to the 'To' value."); form.avmana_dateprocessedfrom.focus(); return false; } //check if fromDate is older than 3 years, if yes show alert msg var currentdate = new Date(); var diff = days_between(fromdate, currentdate); if (diff > 1095) { var reqfromdate= GetFromDate(currentdate); alert("From date may not be earlier than " +(reqfromdate.getMonth()+1)+"/"+reqfromdate.getDate()+"/"+(reqfromdate.getFullYear())+"."); return false; } } if (form.avmana_dateprocessedfrom.value.length > 0 && form.avmana_dateprocessedto.value.length == 0) { var fromdatereq = new Date(form.avmana_dateprocessedfrom.value); var todatereq = new Date(); var diff = days_between(fromdatereq, todatereq); if (diff > 1095) { var reqfromdate= GetFromDate(todatereq); alert("From date may not be earlier than " +(reqfromdate.getMonth()+1)+"/"+reqfromdate.getDate()+"/"+(reqfromdate.getFullYear())+"."); return false; } } if (form.avmana_dateprocessedfrom.value.length > 0 || form.avmana_dateprocessedto.value.length > 0) { var currDate = new Date(); if (form.avmana_dateprocessedfrom.value.length > 0) { var fromdate = new Date(form.avmana_dateprocessedfrom.value); if ((fromdate > currDate)) { alert("The From date cannot be greater than " + (currDate.getMonth() + 1) + "/" + currDate.getDate() + "/" + (currDate.getFullYear()) + "."); return false; } } if (form.avmana_dateprocessedto.value.length > 0) { var todate = new Date(form.avmana_dateprocessedto.value); if ((todate > currDate)) { alert("The To date cannot be greater than " + (currDate.getMonth() + 1) + "/" + currDate.getDate() + "/" + (currDate.getFullYear()) + "."); return false; } } } if (form.avmana_dateprocessedfrom.value.length == 0 && form.avmana_dateprocessedto.value.length > 0) { var todatereq = new Date(form.avmana_dateprocessedto.value); var todate = new Date(); var diff = days_between(todatereq, todate); if (diff > 1095) { alert("The date range must be 3 years or less."); return false; } } /*if (form.avmana_dateprocessedfrom.value.length > 0 && form.avmana_dateprocessedto.value.length > 0) { var fromdate1 = new Date(form.avmana_dateprocessedfrom.value); var todate1 = new Date(form.avmana_dateprocessedto.value); var fromyear = fromdate1.getFullYear(); var toyear = todate1.getFullYear(); var midyear = fromyear + 1; var yeardiff = toyear - fromyear; var frommonth = fromdate1.getMonth(); var tomonth = todate1.getMonth(); var reqdate = todate1.getDate(); if (yeardiff == 3) { if (((fromyear % 4 == 0 && (fromyear % 100 != 0 || fromyear % 400 == 0)) && (frommonth <= 1)) || (toyear % 4 == 0 && ((toyear % 100 != 0 || toyear % 400 == 0)) && ((tomonth == 1 && reqdate == 29) || (tomonth > 1))) || (midyear % 4 == 0)) { var diff = days_between(fromdate1, todate1); if ((diff + 1) > 1096) { alert("The date range must be 3 years or less."); return false; } } else { var diff = days_between(fromdate1, todate1); if ((diff + 1) > 1095) { alert("The date range must be 3 years or less."); return false; } } } if (yeardiff > 3 || yeardiff < 3) { if (((fromyear % 4 == 0 && (fromyear % 100 != 0 || fromyear % 400 == 0)) && (frommonth <= 1)) || (toyear % 4 == 0 && ((toyear % 100 != 0 || toyear % 400 == 0)) && ((tomonth == 1 && reqdate == 29) || (tomonth > 1))) || (midyear % 4 == 0)) { var diff = days_between(fromdate1, todate1); if ((diff + 1) > 1096) { alert("The date range must be 3 years or less."); return false; } } else { var diff = days_between(fromdate1, todate1); if ((diff + 1) > 1095) { alert("The date range must be 3 years or less."); return false; } } } }*/ try {form.type.value = form.avmana_reporttype.value;}catch(ex){} } } if (page!="relogin"){setSubmit();} showHide('close','SearchOption');showHide('close','top_nav');showHide('open','Processing'); /**/ var code = "0"; if (window.event) code = new String(window.event.keyCode); else if (e.which) code = new String(e.which); if(code=="13"){form.submit();} return true; } function days_between(fromdate1, todate1){ var ONE_DAY = 1000 * 60 * 60 * 24 ; var date1_ms = fromdate1.getTime(); var date2_ms = todate1.getTime(); // var difference_ms = Math.abs(date1_ms - date2_ms); var difference_ms = Math.abs(date2_ms - date1_ms); return Math.round(difference_ms/ONE_DAY); } //Added for getting the from date to validate the archival input form function GetFromDate(startDate) { var endDate = new Date(startDate.getTime()); endDate.setDate(endDate.getDate()-(1095 - 1)); // 1 to exculde one day. return endDate; } /*function validatePDFSubmit() { //var sUrl = "javascript:popUpStmt('"+urljspprog+"&action=getwillcap&docType=pdf&"+new Date().getTime()+"');"; var sUrl = "/jsp/rq.jsp?&client=" + "&action=getwillcap&docType=pdf" + "&now=" + new Date().getTime(); return sUrl; } */ function avmAnalyticsArchiveValidation(form, reportType) { var avmCascadeFields = "avmana_housenumber|avmana_streetname|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_refid|avmana_trackingid"; var hveFields = "avmana_housenumber|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_refid"; var historyProFields = "avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_orderno"; var historyProReviewFields = "avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_orderno"; var incomeProFields = "avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_lastname|avmana_firstname|avmana_jobid1|avmana_orderno"; var loanSafeFields = "avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_lastname|avmana_firstname|avmana_refid|avmana_orderno"; var vp4Fields = "avmana_housenumber|avmana_streetname|avmana_city|avmana_state|avmana_zip|avmana_lastname|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_refid|avmana_trackingid"; var barFields = "avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_lastname|avmana_firstname|avmana_loannumber|avmana_refid|avmana_orderno"; var geoavmFields="avmana_address|avmana_city|avmana_state|avmana_zip|avmana_dateprocessedfrom|avmana_dateprocessedto|avmana_refid|avmana_orderno"; var status = false; var archiveField; if (reportType == "vectorarchive") { archiveField = avmCascadeFields.split("|"); } else if (reportType == "hvearchive") { archiveField = hveFields.split("|"); } else if (reportType == "historyproarchive") { archiveField = historyProFields.split("|"); } else if (reportType == "historyproreviewarchive") { archiveField = historyProReviewFields.split("|"); } else if (reportType == "incomeproarchive") { archiveField = incomeProFields.split("|"); } else if (reportType == "vp4archive") { archiveField = vp4Fields.split("|"); } else if (reportType == "loansafearchive" ||reportType == "loansafeFraudarchive" || reportType == "loansafeCollateralarchive" || reportType == "loansafeRiskarchive" ) { archiveField = loanSafeFields.split("|"); } else if (reportType == "barreportarchive") { archiveField = barFields.split("|"); } else if (reportType == "geoavmarchive") { archiveField = geoavmFields.split("|"); } for (var i = 0; i < archiveField.length; i++) { var archiveFieldValue = eval("form." + archiveField[i] + ".value"); if (!blank(archiveFieldValue)) { status = true; break; } } if(status){return false;}else{return true;} } function Validate_Search_Field(form,calledFrom){ var state = ""; if("|Consumer_Subjects_Search|Multi_Subjects_Search|Foreclosure_Search|Custom_Search|Document_Number_Search|Parcel_Map_Search|Street_Map_Search|".indexOf(page)==-1){ if (form.type[0].checked){// _address form.address.value = stripCharacters(form.address.value); if (form.address.value.length==0){ alert("Please enter property address."); form.address.focus();return false; } if (!form.zipcode_address.value.length){ form.city.value = stripCharacters(form.city.value); form.state_address.value = stripCharacters(form.state_address.value); if ((form.city.value.length==0) && (form.state_address.value.length==0)){ alert("Please enter either zipcode OR city/state."); return false; } if (form.city.value.length==0){ if ("Multi_Subjects_Search"!=page){ alert("Please enter city."); form.city.focus(); return false; } } if ((form.state_address.value.length==0)||(form.state_address.value.length<2)){ alert("Please enter state."); form.state_address.focus(); return false; } } else { if (form.zipcode_address.value.length<5){ alert("Please enter a valid zipcode."); form.zipcode_address.value=""; form.zipcode_address.focus(); return false; } if (form.zipcode_address.value.length<0){ alert("Please enter a valid zipcode."); form.zipcode_address.value=""; form.zipcode_address.focus(); return false; } else if (MM_checkNum(form.zipcode_address.value,"zipcode")){} else {form.zipcode_address.focus();return false;} } }else if (form.type[1].checked){// _advancedaddress if (!form.zipcode_advancedaddress.value.length){ if ((!form.county_advancedaddress.value.length) && (!form.state_advancedaddress.value.length||form.state_advancedaddress.value==" ")){ alert("Please enter zipcode OR select state/county."); return false; } if (!form.county_advancedaddress.value.length){alert("Please select county.");form.county_advancedaddress.focus();return false;} } else { if (MM_checkNum(form.zipcode_advancedaddress.value,"zipcode")){} else {form.zipcode_advancedaddress.focus();return false;} } form.houseno.value = stripCharacters(form.houseno.value); form.streetname.value = stripCharacters(form.streetname.value); if ((form.houseno.value.length==0) && (form.streetname.value.length==0)){ alert("Please enter either House No. AND/OR street name."); return false; } }else if (form.type[2].checked){// _range form.houseno_from.value = stripCharacters(form.houseno_from.value); form.houseno_to.value = stripCharacters(form.houseno_to.value); form.streetname_range.value = stripCharacters(form.streetname_range.value); if ((form.houseno_from.value.length==0) || (form.houseno_to.value.length==0) || (form.streetname_range.value.length==0)){ form.houseno_from.focus(); alert("Please enter range search values (From, To, and StreetName)."); return false; } if (!form.zipcode_range.value.length){ form.city_range.value = stripCharacters(form.city_range.value); form.state_range.value = stripCharacters(form.state_range.value); if ((form.city_range.value.length==0) && (form.state_range.value.length==0)){ alert("Please enter either zipcode OR city/state."); return false; } if (form.city_range.value.length==0){ if ("Multi_Subjects_Search"!=page){ alert("Please enter city."); form.city_range.focus(); return false; } } if (form.state_range.value.length==0||form.state_range.value.length<2){ alert("Please enter state."); form.state_range.focus(); return false; } } else { if (form.zipcode_range.value.length<5){alert("Please enter a valid zipcode.");form.zipcode_range.value="";form.zipcode_range.focus();return false;} else if (MM_checkNum(form.zipcode_range.value,"zipcode")){} else {form.zipcode_range.focus();return false;} } var numeric = /^[0-9]*$/; if (numeric.test(form.houseno_to.value)&&numeric.test(form.houseno_from.value)){ if (parseInt(form.houseno_to.value) < parseInt(form.houseno_from.value)){alert("The 'From' value must be less than or equal to the 'To' value");form.houseno_from.focus(); return false;} } }else if (form.type[3].checked){// _ownername if (!form.zipcode_ownername.value.length){ if ((!form.county_ownername.value.length) && (!form.state_ownername.value.length||form.state_ownername.value==" ")){alert("Please enter either zipcode OR select state/county.");return false;} if (!form.county_ownername.value.length){alert("Please select county.");form.county_ownername.focus();return false;} } else { if (MM_checkNum(form.zipcode_ownername.value,"zipcode")){} else {form.zipcode_ownername.focus();return false;} } form.lastname.value = stripCharacters(form.lastname.value); if (form.lastname.value.length==0){ alert("Please enter last name."); form.lastname.focus(); return false; } }else if (form.type[4].checked){// _apn if (!form.zipcode_apn.value.length){ if ((!form.county_apn.value.length) && (!form.state_apn.value.length)){alert("Please enter either zipcode OR select state/county.");return false;} if (!form.county_apn.value.length){alert("Please select county.");form.county_apn.focus();return false;} } else { if (MM_checkNum(form.zipcode_address.value,"zipcode")){} else {form.zipcode_apn.focus();return false;} } form.apn.value = stripCharacters(form.apn.value); if (form.apn.value.length==0){ alert("Please enter an APN."); form.apn.focus(); return false; } } //For VP4 if (form.valuationdate!=null&&form.valuationdate.value.length>0){ if (!checkDateFormat(form.valuationdate.value,"MM/DD/YYYY")){form.valuationdate.value="";form.valuationdate.focus();return false;} if(!Validate_ValuationDate(form)){form.valuationdate.value="";form.valuationdate.focus();return false;} } //Geo AVM Core and Precision. if (form.corevaluationdate!=null&&form.corevaluationdate.value.length>0){ if (!checkDateFormat(form.corevaluationdate.value,"MM/DD/YYYY")){form.corevaluationdate.value="";form.corevaluationdate.focus();return false;} if(!Validate_CoreValuationDate(form)){form.corevaluationdate.value="";form.corevaluationdate.focus();return false;} } if (form.lastsaledate!=null&&form.lastsaledate.value.length>0){ if (!checkDateFormat(form.lastsaledate.value,"MM/YYYY")){form.lastsaledate.value="";form.lastsaledate.focus();return false;} if (form.lastsaleamt!=null&&form.lastsaleamt.value.length==0){alert("Last Sale Amount is required.");form.lastsaleamt.focus();return false;} } if ((form.lastsaleamt!=null&&form.lastsaleamt.value.length>0)&&(form.lastsaledate!=null&&form.lastsaledate.value.length==0)){ alert("Last Sale Date is required.");form.lastsaledate.focus();return false; } //For Optional HVE info. propertytype,transactiontype,purchaseprice,purchasedate if ( (form.propertytype!=null&&form.propertytype.value.length>0 || form.transactiontype!=null&&form.transactiontype.value.length>0 || form.purchaseprice!=null&&form.purchaseprice.value.length>0 || form.purchasedate!=null&&form.purchasedate.value.length>0) && (form.propertytype!=null&&form.propertytype.value.length==0 || form.transactiontype!=null&&form.transactiontype.value.length==0 || form.purchaseprice!=null&&form.purchaseprice.value.length==0 || form.purchasedate!=null&&form.purchasedate.value.length==0) ) { alert("Please complete all four HVE fields"); return false; } //For CASA if (form.cas_valueationdate!=null&&form.cas_valueationdate.value.length>0){ if(!Validate_RetroValueDateCASA(form)){ form.cas_valueationdate.value=""; if (document.getElementById("CASAOptions").style.display=="inline") form.cas_valueationdate.focus(); return false; } } }else { if (page=="Custom_Search"||page=="Foreclosure_Search"){ if (page=="Custom_Search"){ if (!form.zipcode_custom.value.length){ if ((!form.county_custom.value.length) && ((!form.state_custom.value.length)||(form.state_custom.value==" "))){alert("Please enter either zipcode OR select state/county.");return false;} if (!form.county_custom.value.length){alert("Please select county.");form.county_custom.focus();return false;} } DWRController.setPurchasePDataValue("hide"); state = form.state_custom.value; } else if (page=="Foreclosure_Search"){ if (!form.zipcode_foreclosure.value.length){ if ((!form.county_foreclosure.value.length) && ((!form.state_foreclosure.value.length)||(form.state_foreclosure.value==" "))){alert("Please enter either zipcode OR select state/county.");return false;} if (!form.county_foreclosure.value.length){alert("Please select county.");form.county_foreclosure.focus();return false;} } if (form.foreclosure_search_tab[0].checked){ // quick form.fc_QUICKCITY.value = stripCharacters(form.fc_QUICKCITY.value); if (form.foreclosure_active[0].checked && form.fc_RWL.selectedIndex==0){ alert("Please select Recorded option."); return false; }else if(form.foreclosure_active[1].checked && form.fc_AWN.selectedIndex==0){ alert("Please select Auctions option."); return false; }else if(form.foreclosure_active[2].checked && form.fc_QUICKCITY.value.length==0){ alert("Please enter City."); return false; }else if (form.foreclosure_active[3].checked && trim(form.fc_QUICKZIP.value).length==0){ alert("Please enter Zipcode."); return false; } } else if (form.foreclosure_search_tab[1].checked){ // advanced // make sure at least one foreclosure stage is checked var isOneStageChecked = false; for (var i = 0; null != form.cs_FRCLSTAGE && i < form.cs_FRCLSTAGE.length; i++) { if (form.cs_FRCLSTAGE[i].checked) { isOneStageChecked = true; break; } } if ( !isOneStageChecked ) { alert("Please select one or more foreclosure types: Pre-Foreclosure, Auction or REO."); return false; } } state = form.state_foreclosure.value; } if (page=="Custom_Search" || (page=="Foreclosure_Search" && form.foreclosure_search_tab[1].checked)){ if (form.tblreview!=null&&form.tblreview.value.length==0){ alert("Please select and enter search criteria."); return false; } if (gCriteria!=null&&gCriteria.length>0){ var filter = true; for (var i=0; i0 && gAdminJobIDrequired == "yes") || (gJobIDrequired.length>0 && gJobIDrequired == "yes") ){ refIdAllowFlag = true; } return refIdAllowFlag; } function Validate_Billing_Info(form){ var iLen = form.elements.length; for (var i=0; i0 && !numeric.test(theForm.numbermonth.value))){ alert("Please enter a number for the 'Number of Month Back'."); theForm.numbermonth.focus(); return false; } } if (theForm.monthdaterange[1].checked) { if ( theForm.daterangefrom.value.length > 0 && !checkDateFormat(theForm.daterangefrom.value,"MM/YYYY")) { theForm.daterangefrom.value=""; theForm.daterangefrom.focus(); return false; } if ( theForm.daterangeto.value.length > 0 && !checkDateFormat(theForm.daterangeto.value,"MM/YYYY")) { theForm.daterangeto.value=""; theForm.daterangeto.focus(); return false; } //from date and to date validation from date is less than todate starts here if ( theForm.daterangefrom.value.length > 0 && theForm.daterangeto.value.length > 0){ var from_to_result = validate_month_year_from_to(theForm.daterangefrom.value,theForm.daterangeto.value); if(!from_to_result){ alert(errorMsg); theForm.daterangefrom.focus(); return false; } } //ends here } // saleprice validations start here if(theForm.salepricefrom.value.length>0 && !numeric.test(theForm.salepricefrom.value)){ alert("Please enter a number for the Sale Price 'From'."); theForm.salepricefrom.focus(); return false; } if(theForm.salepriceto.value.length>0 && !numeric.test(theForm.salepriceto.value)){ alert("Please enter a number for the Sale Price 'To'."); theForm.salepriceto.focus(); return false; } if(theForm.salepricefrom.value.length>0 && theForm.salepriceto.value.length>0){ var from_to_saleprice = validate_from_to_fields(theForm.salepricefrom.value,theForm.salepriceto.value); if(!from_to_saleprice){ alert(errorMsg); theForm.salepricefrom.focus(); return false; } } // saleprice validations end here // year built validations start here if(theForm.yearbuiltfrom.value.length>0 && !year.test(theForm.yearbuiltfrom.value)){ alert(yearErrorMsg); theForm.yearbuiltfrom.focus(); return false; } if(theForm.yearbuiltto.value.length>0 && !year.test(theForm.yearbuiltto.value)){ alert(yearErrorMsg); theForm.yearbuiltto.focus(); return false; } if(theForm.yearbuiltfrom.value.length>0 && theForm.yearbuiltto.value.length>0){ var from_to_yearbuilt = validate_from_to_fields(theForm.yearbuiltfrom.value,theForm.yearbuiltto.value); if(!from_to_yearbuilt){ alert(errorMsg); theForm.yearbuiltfrom.focus(); return false; } } // year built validations end here // Bedrooms validations start here if(theForm.bedroomfrom.value.length>0 && !numeric.test(theForm.bedroomfrom.value)){ alert("Please enter a number for the Bedrooms 'From'."); theForm.bedroomfrom.focus(); return false; } if(theForm.bedroomto.value.length>0 && !numeric.test(theForm.bedroomto.value)){ alert("Please enter a number for the Bedrooms 'To'."); theForm.bedroomto.focus(); return false; } if(theForm.bedroomfrom.value.length>0 && theForm.bedroomto.value.length>0){ var from_to_bedroom = validate_from_to_fields(theForm.bedroomfrom.value,theForm.bedroomto.value); if(!from_to_bedroom){ alert(errorMsg); theForm.bedroomfrom.focus(); return false; } } // Bedrooms validations end here // Bathrooms validations start here if(theForm.bathroomfrom.value.length>0 && !numericWithDecimal.test(theForm.bathroomfrom.value)){ alert("Please enter a number for the Bathrooms 'From'."); theForm.bathroomfrom.focus(); return false; } if(theForm.bathroomto.value.length>0 && !numericWithDecimal.test(theForm.bathroomto.value)){ alert("Please enter a number for the Bathrooms 'To'."); theForm.bathroomto.focus(); return false; } if(theForm.bathroomfrom.value.length>0 && theForm.bathroomto.value.length>0){ var from_to_bathroom = validate_from_to_fields(theForm.bathroomfrom.value,theForm.bathroomto.value); if(!from_to_bathroom){ alert(errorMsg); theForm.bathroomfrom.focus(); return false; } } // Bathrooms validations end here // stories validations start here if(theForm.storiesfrom.value.length>0 && !numericWithDecimal.test(theForm.storiesfrom.value)){ alert("Please enter a number for the Stories 'From'."); theForm.storiesfrom.focus(); return false; } if(theForm.storiesto.value.length>0 && !numericWithDecimal.test(theForm.storiesto.value)){ alert("Please enter a number for the Stories 'To'."); theForm.storiesto.focus(); return false; } if(theForm.storiesfrom.value.length>0 && theForm.storiesto.value.length>0){ var from_to_stories = validate_from_to_fields(theForm.storiesfrom.value,theForm.storiesto.value); if(!from_to_stories){ alert(errorMsg); theForm.storiesfrom.focus(); return false; } } // stories validations end here // living area percent range validations start here if (theForm.livingareapercentrange[0].checked) { if (/*theForm.grosslivingarea.value.length==0 || */(theForm.grosslivingarea.value.length>0 && !numeric.test(theForm.grosslivingarea.value))){ alert("Please enter a number for the 'Living Area Difference'."); theForm.grosslivingarea.focus(); return false; } } if (theForm.livingareapercentrange[1].checked) { // living range validations start here if (theForm.grosslivingfrom.value.length>0 && !numeric.test(theForm.grosslivingfrom.value)){ alert("Please enter a number for the Living Range 'From'."); theForm.grosslivingfrom.focus(); return false; } if (theForm.grosslivingto.value.length>0 && !numeric.test(theForm.grosslivingto.value)){ alert("Please enter a number for the Living Range 'To'."); theForm.grosslivingto.focus(); return false; } var from_to_living_range = validate_from_to_fields(theForm.grosslivingfrom.value,theForm.grosslivingto.value); if(!from_to_living_range){ alert(errorMsg); theForm.grosslivingfrom.focus(); return false; } // living range validations end here } // living area percent range validations end here // Lotareapercentrange validations start here if (theForm.lotareapercentrange[0].checked) { if ((theForm.lotarea.value.length>0 && !numeric.test(theForm.lotarea.value))){ alert("Please enter a number for the 'Lot Area Difference'."); theForm.lotarea.focus(); return false; } } if (theForm.lotareapercentrange[1].checked) { // lot range validations start here if (theForm.lotareafrom.value.length>0 && !numeric.test(theForm.lotareafrom.value)){ alert("Please enter a number for the Lot Area Range 'From'."); theForm.lotareafrom.focus(); return false; } if (theForm.lotareato.value.length>0 && !numeric.test(theForm.lotareato.value)){ alert("Please enter a number for the Lot Area Range 'To'."); theForm.lotareato.focus(); return false; } var from_to_lot_range = validate_from_to_fields(theForm.lotareafrom.value,theForm.lotareato.value); if(!from_to_lot_range){ alert(errorMsg); theForm.lotareafrom.focus(); return false; } // lot range validations end here } // Lotareapercentrange validations end here return true; } function validateCompsCommercial(theForm){ //The following regular expressions test for empty string or what their name is var numeric = /^[0-9]*$/ var numericWithDecimal = /^(\d)*\.?\d{1,3}$/ var date = /^(\d{2}\/\d{4})*$/ //MM/YYYY var year = /^([1-2]\d{3})*$/ //YYYY var errorMsg = "The 'From' value must be less than or equal to the 'To' value."; var yearErrorMsg = "Invalid year format.\nCorrect year format is YYYY"; if (theForm.comm_monthdaterange[0].checked) { if ((theForm.comm_numbermonth.value.length>0 && !numeric.test(theForm.comm_numbermonth.value))){ alert("Please enter a number for the 'Number of Month Back'."); theForm.comm_numbermonth.focus(); return false; } } if (theForm.comm_monthdaterange[1].checked) { if ( theForm.comm_daterangefrom.value.length > 0 && !checkDateFormat(theForm.comm_daterangefrom.value,"MM/YYYY")) { theForm.comm_daterangefrom.value=""; theForm.comm_daterangefrom.focus(); return false; } if ( theForm.comm_daterangeto.value.length > 0 && !checkDateFormat(theForm.comm_daterangeto.value,"MM/YYYY")) { theForm.comm_daterangeto.value=""; theForm.comm_daterangeto.focus(); return false; } if ( theForm.comm_daterangefrom.value.length > 0 && theForm.comm_daterangeto.value.length > 0 ){ var from_to_result_comm = validate_month_year_from_to(theForm.comm_daterangefrom.value,theForm.comm_daterangeto.value); if(!from_to_result_comm){ alert(errorMsg); theForm.comm_daterangefrom.focus(); return false; } } } // saleprice validations start here if(theForm.comm_salepricefrom.value.length>0 && !numeric.test(theForm.comm_salepricefrom.value)){ alert("Please enter a number for the Sale Price 'From'."); theForm.comm_salepricefrom.focus(); return false; } if(theForm.comm_salepriceto.value.length>0 && !numeric.test(theForm.comm_salepriceto.value)){ alert("Please enter a number for the Sale Price 'To'."); theForm.comm_salepriceto.focus(); return false; } if(theForm.comm_salepricefrom.value.length>0 && theForm.comm_salepriceto.value.length>0){ var from_to_saleprice_comm = validate_from_to_fields(theForm.comm_salepricefrom.value,theForm.comm_salepriceto.value); if(!from_to_saleprice_comm){ alert(errorMsg); theForm.comm_salepricefrom.focus(); return false; } } // saleprice validations end here // year built validations start here if(theForm.comm_yearbuiltfrom.value.length>0 && !year.test(theForm.comm_yearbuiltfrom.value)){ alert(yearErrorMsg); theForm.comm_yearbuiltfrom.focus(); return false; } if(theForm.comm_yearbuiltto.value.length>0 && !year.test(theForm.comm_yearbuiltto.value)){ alert(yearErrorMsg); theForm.comm_yearbuiltto.focus(); return false; } if(theForm.comm_yearbuiltfrom.value.length>0 && theForm.comm_yearbuiltto.value.length>0){ var from_to_yearbuilt_comm = validate_from_to_fields(theForm.comm_yearbuiltfrom.value,theForm.comm_yearbuiltto.value); if(!from_to_yearbuilt_comm){ alert(errorMsg); theForm.comm_yearbuiltfrom.focus(); return false; } } // year built validations end here // Restrooms validations start here if(theForm.comm_bathroomfrom.value.length>0 && !numericWithDecimal.test(theForm.comm_bathroomfrom.value)){ alert("Please enter a number for the Restrooms 'From'."); theForm.comm_bathroomfrom.focus(); return false; } if(theForm.comm_bathroomto.value.length>0 && !numericWithDecimal.test(theForm.comm_bathroomto.value)){ alert("Please enter a number for the Restrooms 'To'."); theForm.comm_bathroomto.focus(); return false; } if(theForm.comm_bathroomfrom.value.length>0 && theForm.comm_bathroomto.value.length>0){ var from_to_restrooms_comm = validate_from_to_fields(theForm.comm_bathroomfrom.value,theForm.comm_bathroomto.value); if(!from_to_restrooms_comm){ alert(errorMsg); theForm.comm_bathroomfrom.focus(); return false; } } // Restrooms validations start here // stories validations start here if(theForm.comm_storiesfrom.value.length>0 && !numericWithDecimal.test(theForm.comm_storiesfrom.value)){ alert("Please enter a number for the Stories 'From'."); theForm.comm_storiesfrom.focus(); return false; } if(theForm.comm_storiesto.value.length>0 && !numericWithDecimal.test(theForm.comm_storiesto.value)){ alert("Please enter a number for the Stories 'To'."); theForm.comm_storiesto.focus(); return false; } if(theForm.comm_storiesfrom.value.length>0 && theForm.comm_storiesto.value.length>0){ var from_to_stories_comm = validate_from_to_fields(theForm.comm_storiesfrom.value,theForm.comm_storiesto.value); if(!from_to_stories_comm){ alert(errorMsg); theForm.comm_storiesfrom.focus(); return false; } } // stories validations end here // building area percent range validations start here if (theForm.comm_livingareapercentrange[0].checked) { if ((theForm.comm_grosslivingarea.value.length>0 && !numeric.test(theForm.comm_grosslivingarea.value))){ alert("Please enter a number for the 'Building Area Difference'."); theForm.comm_grosslivingarea.focus(); return false; } } if (theForm.comm_livingareapercentrange[1].checked) { if (theForm.comm_grosslivingfrom.value.length>0 && !numeric.test(theForm.comm_grosslivingfrom.value)){ alert("Please enter a number for the Building Range 'From'."); theForm.comm_grosslivingfrom.focus(); return false; } if (theForm.comm_grosslivingto.value.length>0 && !numeric.test(theForm.comm_grosslivingto.value)){ alert("Please enter a number for the Building Range 'To'."); theForm.comm_grosslivingto.focus(); return false; } // building range validations start here var from_to_building_range_comm = validate_from_to_fields(theForm.comm_grosslivingfrom.value,theForm.comm_grosslivingto.value); if(!from_to_building_range_comm){ alert(errorMsg); theForm.comm_grosslivingfrom.focus(); return false; } // building range validations end here } // building area percent range validations end here // lotareapercentrange validations start here if (theForm.comm_lotareapercentrange[0].checked) { if ((theForm.comm_lotarea.value.length>0 && !numeric.test(theForm.comm_lotarea.value))){ alert("Please enter a number for the 'Lot Area Difference'."); theForm.comm_lotarea.focus(); return false; } } if (theForm.comm_lotareapercentrange[1].checked) { if (theForm.comm_lotareafrom.value.length>0 && !numeric.test(theForm.comm_lotareafrom.value)){ alert("Please enter a number for the Lot Area Range 'From'."); theForm.comm_lotareafrom.focus(); return false; } if (theForm.comm_lotareato.value.length>0 && !numeric.test(theForm.comm_lotareato.value)){ alert("Please enter a number for the Lot Area Range 'To'."); theForm.comm_lotareato.focus(); return false; } // lot area validations start here var from_to_lot_area_comm = validate_from_to_fields(theForm.comm_lotareafrom.value,theForm.comm_lotareato.value); if(!from_to_lot_area_comm){ alert(errorMsg); theForm.comm_lotareafrom.focus(); return false; } // lot area validations end here } // lotareapercentrange validations end here return true; } // validate Date from and to fields - starts here function validate_month_year_from_to(fromDate,toDate) { from_mm = fromDate.substring(0,2); from_yyyy = fromDate.substring(3,7); to_mm = toDate.substring(0,2); to_yyyy = toDate.substring(3,7); if(from_yyyy == to_yyyy){ if(from_mm > to_mm){ return false; }else{ return true; } } else if(from_yyyy > to_yyyy){ return false; }else{ return true; } } // validate Date from and to fields - ends here // validation of from field is less than to field - starts here function validate_from_to_fields(fval,toval){ try{ var v_f_date = parseFloat(fval); var v_to_date = parseFloat(toval) if(v_f_date > v_to_date){ return false; }else{ return true; } }catch(e){ return false; } } // validation of from field is less than to field - ends here function Validate_DocImageOrders(){ var theForm = document.forms[0]; //The following regular expressions test for empty string or what their name is var alphaNumeric = /^[0-9a-zA-Z]*$/; var alpha = /^[a-zA-Z]*$/; var names = /^[a-zA-Z,.\-\ ]*$/; var alphaNumericWithDash = /^[-0-9a-zA-Z]*$/; var numeric = /^[0-9]*$/; var date = /^(\d{2}\/\d{2}\/\d{4})*$/; //MM-DD-YYYY var numericWithDecimal = /^(\d)*\.?\d*$/; var zip = /^(\d{5})*$/; //5 digit zip var phone = /^(\d{3}\-\d{3}\-\d{4})*$/; //xxx-xxx-xxxx var ssn = /^(\d{3}\-\d{2}\-\d{4})*$/; //xxx-xx-xxxx var email = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; // check the required fields first if (theForm.docimageorder_doctype.value == null || theForm.docimageorder_doctype.value == ""){ alert("Please select Document Type."); theForm.docimageorder_doctype.focus(); return false; } if (theForm.docimageorder_subtype.value == null || theForm.docimageorder_subtype.value.length == ""){ alert("Please select Document Sub-Type."); theForm.docimageorder_subtype.focus(); return false; } if (theForm.docimageorder_docno.value == null || theForm.docimageorder_docno.value == ""){ alert("Please enter Document Number."); theForm.docimageorder_docno.focus(); return false; } if (theForm.docimageorder_recorddate.value == null || theForm.docimageorder_recorddate.value == "" || !date.test(theForm.docimageorder_recorddate.value) || isFutureDate(theForm.docimageorder_recorddate.value)){ alert("Please enter Recording Date in (MM/DD/YYYY) format and not in future."); theForm.docimageorder_recorddate.focus(); return false; } if (theForm.docimageorder_doctype.value == "M" || theForm.docimageorder_doctype.value == "MORTGAGE") { if (theForm.docimageorder_mortgageamount.value == null || theForm.docimageorder_mortgageamount.value == "" || !numeric.test(theForm.docimageorder_mortgageamount.value)){ alert("Please enter a numeric value for Mortgage Amount."); theForm.docimageorder_mortgageamount.focus(); return false; } if (theForm.docimageorder_subtype.value == "PA" || theForm.docimageorder_subtype.value == "ASSIGNMENT") { if (theForm.docimageorder_assignfrom.value == null || theForm.docimageorder_assignfrom.value == ""){ alert("Please enter Assign From."); theForm.docimageorder_assignfrom.focus(); return false; } if (theForm.docimageorder_assignto.value == null || theForm.docimageorder_assignto.value == ""){ alert("Please enter Assign To."); theForm.docimageorder_assignto.focus(); return false; } } } if (theForm.docimageorder_street.value == null || theForm.docimageorder_street.value == ""){ alert("Please enter Street Address."); theForm.docimageorder_street.focus(); return false; } if (theForm.docimageorder_city.value == null || theForm.docimageorder_city.value == ""){ alert("Please enter City."); theForm.docimageorder_city.focus(); return false; } if (theForm.docimageorder_state.value == null || theForm.docimageorder_state.value == ""){ alert("Please enter State."); theForm.docimageorder_state.focus(); return false; } if (theForm.docimageorder_county.value == null || theForm.docimageorder_county.value == ""){ alert("Please enter County."); theForm.docimageorder_county.focus(); return false; } if (theForm.docimageorder_zip.value == null || theForm.docimageorder_zip.value == "" || !zip.test(theForm.docimageorder_zip.value)){ alert("Please enter 5 digits Zipcode."); theForm.docimageorder_zip.focus(); return false; } if (theForm.docimageorder_firstname.value == null || theForm.docimageorder_firstname.value == ""){ alert("Please enter First Name."); theForm.docimageorder_firstname.focus(); return false; } if (theForm.docimageorder_lastname.value == null || theForm.docimageorder_lastname.value == ""){ alert("Please enter Last Name."); theForm.docimageorder_lastname.focus(); return false; } if (theForm.docimageorder_referenceid.value == null || theForm.docimageorder_referenceid.value == ""){ alert("Please enter Reference ID."); theForm.docimageorder_referenceid.focus(); return false; } if (theForm.docimageorder_email.value == null || theForm.docimageorder_email.value == "" || !email.test(theForm.docimageorder_email.value)){ alert("Please enter a valid Email."); theForm.docimageorder_email.focus(); return false; } return true; } function validatePreferencesForm(form) { if (eval("Validate_" + page + "(form);")) { if (null != form.liensuite && form.liensuite.checked && !validateLienSuiteReportOptions()) { showSubReportErrorMsg("Lien360 Suite Reports"); return false; } if (null != form.neighborhoodinformation && form.neighborhoodinformation.checked && !validateNeighborhoodReportOptions()) { showSubReportErrorMsg("Neighborhood Reports"); return false; } //Added for validating AVM Cascade options while submitting the request if ((null != form.vector && form.vector.checked) && !validateAVMCascadeOptions()) { if (guserstatus != 'ENDUSER') { alert("Please select at least one of the AVM Cascade Report from the Report Options list. To retain the changes please save it from 'My Preferences'."); } else { alert("AVM Cascade Report option is not set. Please contact your administrator to request it"); } return false; } enableSubReportOptions(); return true; } else { return false; } }