//********************************************************************************* // VALIDATION SCRIPTS //********************************************************************************* function validate_password_input() { frm=document.forgot_form; if (!validateEmail(frm.email.value)){alert("Please enter the correct email address like xxx@yyy.zzz");frm.email.focus();return false;} } function validate_CC_form() { frm=document.payment_form; if (frm.cc_firstname.value=='') {alert("Please enter the cardholder firstname");frm.cc_firstname.focus();return false;} if (frm.cc_lastname.value=='') {alert("Please enter the cardholder lastname");frm.cc_lastname.focus();return false;} if (frm.cc_number.value=='') {alert("Please enter the credit card number");frm.cc_number.focus();return false;} if (isNaN(frm.cc_number.value)) {alert("Invalid credit card number. Make sure it doesn't contain any alphabets, spaces Or characters like -,# etc"); frm.cc_number.focus();return false; } if (frm.cc_expiry.value=='') {alert("Please enter the credit card expiry");frm.cc_expiry.focus();return false;} return true; //if (frm.exp_mon.value=='') {alert("Month of expiry can not be blank");frm.exp_mon.focus();return false;} //if (frm.exp_year.value=='') {alert("Year of expiry can not be blank");frm.exp_year.focus();return false;} //if (submit > 0 ) return false; //alert('Your payment is currently being processed. This process could take up to 60 seconds to complete.\n\n'+'Please wait till you receive the payment confirmation on your screen. Your screen may remain blank or unchanged for some time before you get your confirmation.\n\n'+'Please click "OK" below to close this box'); //submit++; } function validate_edit() { frm = document.edit_form; if(frm.firstname.value ==""){alert("Please enter the first name");frm.firstname.focus();return false;} if(frm.lastname.value ==""){alert("Please enter the last name");frm.lastname.focus();return false;} if(frm.address.value ==""){alert("Please enter the address");frm.address.focus();return false;} if(frm.city.value ==""){alert("Please enter the city");frm.city.focus();return false;} if(frm.zip.value ==""){alert("Please enter the correct zip");frm.zip.focus();return false;} if(isNaN(frm.zip.value)){alert("Please enter the correct zip");frm.zip.focus();return false;} if(frm.phone.value ==""){alert("Please enter the correct phone number");frm.phone.focus();return false;} if (!validateEmail(frm.email.value)){alert("Please enter the correct email address like xxx@yyy.zzz");frm.email.focus();return false;} if(frm.password.value==""){alert("Please enter the password");frm.password.focus();return false;} } function validate_login() { if(document.loginform.username.value == "") { alert("Please enter the username"); document.loginform.username.focus(); return false; } if(document.loginform.password.value == "") { alert("Please enter the password"); document.loginform.password.focus(); return false; } return true; }//validate_login() //********************************************************************************* function isDigit (c) { return ((c >= "0") && (c <= "9")) } function validateEmail(email) { // This function is used to validate a given e-mail // address for the proper syntax if (email == ""){ return false; } badStuff = ";:/,' \"\\"; for (i=0; i email.length){ return false; } return true } function setval_adult(selvalue) { //disable script for (var i=0;i < document.forms[0].elements.length;i++) { var e = document.forms[0].elements[i]; var elementname=new String(e.name); if(e.name != "adults_covered") { if(elementname.substr(0,5)== "adult") { e.disabled=true; } } } //enable script for (var i=0;i < document.forms[0].elements.length;i++) { var e = document.forms[0].elements[i]; var elementname=new String(e.name); for(var x=1; x<= selvalue;x++) { if(elementname.substr(0,5)== "adult") { if(elementname.substring(5,6)== x) e.disabled=false; } } } } function setval_child(selvalue) { //disable script for (var i=0;i < document.forms[0].elements.length;i++) { var e = document.forms[0].elements[i]; var elementname=new String(e.name); if(e.name != "children_covered") { if(elementname.substr(0,5)== "child") { e.disabled=true; } } } //enable script for (var i=0;i < document.forms[0].elements.length;i++) { var e = document.forms[0].elements[i]; var elementname=new String(e.name); for(var x=1; x<= selvalue;x++) { if(elementname.substr(0,5)== "child") { if(elementname.substring(5,6)== x) e.disabled=false; } } } } function validate_contactinfo(purpose) { if(purpose == "Medical Leads Insurance") { if((document.thanks_form.adults_covered[0].checked==false)&& (document.thanks_form.adults_covered[1].checked==false) && (document.thanks_form.adults_covered[2].checked==false)&& (document.thanks_form.adults_covered[3].checked==false)) { alert("Please select the option for number of adults covered"); document.thanks_form.adults_covered[0].focus(); return false; } for(var t=0;t<4;t++) { if(document.thanks_form.adults_covered[t].checked==true) { z=eval(document.thanks_form.adults_covered[t].value); for(var f=1;f<=z;f++) { var frm_firstname=eval("document.thanks_form.adult" + f + "_firstname"); var frm_lastname=eval("document.thanks_form.adult" + f + "_lastname"); var frm_dob=eval("document.thanks_form.adult" + f + "_dob"); var frm_weight=eval("document.thanks_form.adult" + f + "_weight"); var frm_height_feet=eval("document.thanks_form.adult" + f + "_height_feet"); var frm_height_inches=eval("document.thanks_form.adult" + f + "_height_inches"); if(frm_firstname.value == "") { alert("Please enter the adult" + f + " firstname"); frm_firstname.focus(); return false; } if(frm_lastname.value == "") { alert("Please enter the adult" + f + " lastname"); frm_lastname.focus(); return false; } if(frm_dob.value == "") { alert("Please enter the adult" + f + " date of birth"); frm_dob.focus(); return false; } if(frm_weight.value == "") { alert("Please enter the adult" + f + " weight"); frm_weight.focus(); return false; } if(isNaN(frm_weight.value)) { alert("Please enter the correct adult" + f + " weight"); frm_weight.focus(); return false; } if(frm_height_feet.value == "") { alert("Please enter the adult" + f + " height (feet)"); frm_height_feet.focus(); return false; } if(isNaN(frm_height_feet.value)) { alert("Please enter the correct adult" + f + " height(feet)"); frm_weight.focus(); return false; } if(frm_height_inches.value == "") { alert("Please enter the adult" + f + " height (inches)"); frm_height_inches.focus(); return false; } if(isNaN(frm_height_inches.value)) { alert("Please enter the correct adult" + f + " height(inches)"); frm_height_inches.focus(); return false; } }//for }//if if(document.thanks_form.children_covered[t].checked==true) { z=eval(document.thanks_form.children_covered[t].value); for(var f=1;f<=z;f++) { var frm_childfirstname=eval("document.thanks_form.child" + f + "_firstname"); var frm_childlastname=eval("document.thanks_form.child" + f + "_lastname"); var frm_childdob=eval("document.thanks_form.child" + f + "_dob"); if(frm_childfirstname.value=="") { alert("Please enter the child" + f + " firstname"); frm_childfirstname.focus(); return false; } if(frm_childlastname.value=="") { alert("Please enter the child" + f + " lastname"); frm_childlastname.focus(); return false; } if(frm_childdob.value=="") { alert("Please enter the child" + f + " date of birth"); frm_childdob.focus(); return false; } } } }//for } if(purpose == "Health Insurance") { if(document.thanks_form.zip_code.value == "") { alert("Please enter the zip code"); document.thanks_form.zip_code.focus(); return false; } if(isNaN(document.thanks_form.zip_code.value)) { alert("Please enter the correct zip"); document.thanks_form.zip_code.focus(); return false; } if(document.thanks_form.no_of_employees_to_be_covered.value == "") { alert("Please enter the number of employees to be covered"); document.thanks_form.no_of_employees_to_be_covered.focus(); return false; } if(isNaN(document.thanks_form.no_of_employees_to_be_covered.value)) { alert("Please enter the correct number of employees to be covered"); document.thanks_form.no_of_employees_to_be_covered.focus(); return false; } if(document.thanks_form.date_you_would_like_policy_to_go_into_effect.value == "") { alert("Please enter the date you would like policy to go into effect"); document.thanks_form.date_you_would_like_policy_to_go_into_effect.focus(); return false; } if(document.thanks_form.business_name.value == "") { alert("Please enter the business name"); document.thanks_form.business_name.focus(); return false; } if(document.thanks_form.business_description.value == "") { alert("Please enter the business description"); document.thanks_form.business_description.focus(); return false; } if(document.thanks_form.no_of_years_company_has_been_in_business.value == "") { alert("Please enter the number of years company has been in business"); document.thanks_form.no_of_years_company_has_been_in_business.focus(); return false; } if(document.thanks_form.description_of_business_looking_for.value == "") { alert("Please enter the description of the type of business you are looking for"); document.thanks_form.description_of_business_looking_for.focus(); return false; } if(document.thanks_form.most_current_insurance_policy_expires_on.value == "") { alert("Please enter when the most current insurance policy expires"); document.thanks_form.most_current_insurance_policy_expires_on.focus(); return false; } } if(document.thanks_form.firstname.value == "") { alert("Please enter the firstname"); document.thanks_form.firstname.focus(); return false; } if(document.thanks_form.lastname.value == "") { alert("Please enter the lastname"); document.thanks_form.lastname.focus(); return false; } if((purpose != "Worker Compensation") && (purpose !="Commercial Insurance") && (purpose != "Farm and Ranch Insurance") && (purpose != "Speciality Items Insurance") && (purpose != "Health Insurance") && (purpose != "Long-term Care Insurance") && (purpose !="Annuities Insurance") && (purpose !="Homeowner Insurance (Contd)") && (purpose !="Medical Leads Insurance")) { if(document.thanks_form.dob.value == "") { alert("Please enter the date of birth"); document.thanks_form.dob.focus(); return false; } }//if if(purpose == "Annuities Insurance") { if(document.thanks_form.age.value=="") { alert("Please enter the age"); document.thanks_form.age.focus(); return false; } } if(document.thanks_form.address.value == "") { alert("Please enter the address"); document.thanks_form.address.focus(); return false; } if(document.thanks_form.city.value == "") { alert("Please enter the city"); document.thanks_form.city.focus(); return false; } if(purpose=="Speciality Items Insurance") { if(document.thanks_form.company_name.value=="") { alert("Please enter the company name"); document.thanks_form.company_name.focus(); return false; } } if((purpose =="Farm and Ranch Insurance")||(purpose == "Health Insurance")||(purpose == "Medical Leads Insurance")) { if(document.thanks_form.county.value=="") { alert("Please enter the county"); document.thanks_form.county.focus(); return false; } } if(purpose != "Long-term Care Insurance") { if(document.thanks_form.state.value == "") { alert("Please choose the state"); document.thanks_form.state.focus(); return false; } if(document.thanks_form.zip.value == "") { alert("Please enter the zip"); document.thanks_form.zip.focus(); return false; } if(isNaN(document.thanks_form.zip.value)) { alert("Please enter the correct zip"); document.thanks_form.zip.focus(); return false; } } if(document.thanks_form.email.value == "") { alert("Please enter the email address"); document.thanks_form.email.focus(); return false; } if(!validateEmail(document.thanks_form.email.value)) { alert("Please enter the correct email as 'joe@aol.com'"); document.thanks_form.email.focus(); return false; } if(document.thanks_form.homestdcode.value=="") { alert("Please enter the home std code"); document.thanks_form.homestdcode.focus(); return false; } if(isNaN(document.thanks_form.homestdcode.value)) { alert("Please enter the correct home std code"); document.thanks_form.homestdcode.focus(); return false; } if(document.thanks_form.homephone.value=="") { alert("Please enter the home phone"); document.thanks_form.homephone.focus(); return false; } if(isNaN(document.thanks_form.homephone.value)) { alert("Please enter the correct home phone"); document.thanks_form.homephone.focus(); return false; } if(purpose == "Long-term Care Insurance") { if(document.thanks_form.daytimestdcode.value=="") { alert("Please enter the daytime std code"); document.thanks_form.daytimestdcode.focus(); return false; } if(isNaN(document.thanks_form.daytimestdcode.value)) { alert("Please enter the correct daytime std code"); document.thanks_form.daytimestdcode.focus(); return false; } if(document.thanks_form.daytimephone.value=="") { alert("Please enter the daytime phone"); document.thanks_form.daytimephone.focus(); return false; } if(isNaN(document.thanks_form.daytimephone.value)) { alert("Please enter the correct daytime phone"); document.thanks_form.daytimephone.focus(); return false; } } if(purpose == "Health Insurance") { if(document.thanks_form.workstdcode.value=="") { alert("Please enter the work std code"); document.thanks_form.workstdcode.focus(); return false; } if(isNaN(document.thanks_form.workstdcode.value)) { alert("Please enter the correct work std code"); document.thanks_form.workstdcode.focus(); return false; } if(document.thanks_form.workphone.value=="") { alert("Please enter the work phone"); document.thanks_form.workphone.focus(); return false; } if(isNaN(document.thanks_form.workphone.value)) { alert("Please enter the correct work phone"); document.thanks_form.workphone.focus(); return false; } } if(purpose == "Mobile Homes Insurance") { if(document.thanks_form.same_address_as_above.checked==false) { if(document.thanks_form.different_address.value=="") { alert("Please enter the address to be quoted"); document.thanks_form.different_address.focus(); return false; } } } if(purpose == "Commercial Insurance") { if(document.thanks_form.business_name.value=="") { alert("Please enter the business name"); document.thanks_form.business_name.focus(); return false; } if(document.thanks_form.no_of_years_company_has_been_in_business.value=="") { alert("Please enter the number of years company has been in business"); document.thanks_form.no_of_years_company_has_been_in_business.focus(); return false; } if(isNaN(document.thanks_form.no_of_years_company_has_been_in_business.value)) { alert("Please enter the correct number of years for which company has been in business"); document.thanks_form.no_of_years_company_has_been_in_business.focus(); return false; } }//if return true; }//validate_contactinfo() function validatehouseowner() { if(document.form1.live_address.value=="") { alert("Please enter the address"); document.form1.live_address.focus(); return false; } if(document.form1.live_city.value=="") { alert("Please enter the city"); document.form1.live_city.focus(); return false; } if(document.form1.live_zip.value=="") { alert("Please enter the zip"); document.form1.live_zip.focus(); return false; } if(isNaN(document.form1.live_zip.value)) { alert("Please enter the correct zip"); document.form1.live_zip.focus(); return false; } if(document.form1.live_build_year.value=="") { alert("Please enter the build year"); document.form1.live_build_year.focus(); return false; } if(isNaN(document.form1.live_build_year.value)) { alert("Please enter the correct build year"); document.form1.live_build_year.focus(); return false; } return true; }//validatehouseowner() function validatehouseowner1() { if(document.form2.amount_coverage.value=="") { alert("Please enter the coverage amount"); document.form2.amount_coverage.focus(); return false; } if(isNaN(document.form2.amount_coverage.value)) { alert("Please enter the correct coverage amount"); document.form2.amount_coverage.focus(); return false; } if(document.form2.approx_residence_size.value=="") { alert("Please enter the approximate residence size"); document.form2.approx_residence_size.focus(); return false; } if(isNaN(document.form2.approx_residence_size.value)) { alert("Please enter the correct approximate residence size"); document.form2.approx_residence_size.focus(); return false; } if(document.form2.approx_groundfloor_size.value=="") { alert("Please enter the approximate ground floor size"); document.form2.approx_groundfloor_size.focus(); return false; } if(isNaN(document.form2.approx_groundfloor_size.value)) { alert("Please enter the correct approximate ground floor size"); document.form2.approx_groundfloor_size.focus(); return false; } return true; }//validatehouseowner1() function validatehouseowner2() { if(document.form3.current_insurance_policy_expire.value=="") { alert("Please enter when will the current insurance policy expires"); document.form3.current_insurance_policy_expire.focus(); return false; } return true; }//validatehouseowner2() function setCheckboxes(the_form, do_check) { var elts = document.forms[the_form].elements['check1[]']; var elts_cnt = (typeof(elts.length) != 'undefined') ? elts.length : 0; if (elts_cnt) { for (var i = 0; i < elts_cnt; i++) { elts[i].checked = do_check; } // end for } else { elts.checked = do_check; } // end if... else return true; } // end of the 'setCheckboxes()' function function validate_editlead() { if(document.editlead_form.firstname.value=="") { alert("Please enter the firstname"); document.editlead_form.firstname.focus(); return false; } if(document.editlead_form.lastname.value=="") { alert("Please enter the lastname"); document.editlead_form.lastname.focus(); return false; } if(document.editlead_form.address.value=="") { alert("Please enter the address"); document.editlead_form.address.focus(); return false; } if(document.editlead_form.city.value=="") { alert("Please enter the city"); document.editlead_form.city.focus(); return false; } if(document.editlead_form.zip.value=="") { alert("Please enter the zip"); document.editlead_form.zip.focus(); return false; } if(isNaN(document.editlead_form.zip.value)) { alert("Please enter the correct zip"); document.editlead_form.zip.focus(); return false; } if(document.editlead_form.homephone.value=="") { alert("Please enter the phone"); document.editlead_form.homephonefocus(); return false; } if(document.editlead_form.email.value=="") { alert("Please enter the email"); document.editlead_form.email.focus(); return false; } if (!validateEmail(document.editlead_form.email.value)) { alert("Please enter the correct email address like xxx@yyy.zzz"); document.editlead_form.email.focus(); return false; } return true; }//validate_editlead() function pass_validate() { if(document.calling_pass.uname_pass.value=="") { alert("Please enter the username"); document.calling_pass.uname_pass.focus(); return false; } return true; }//pass_validate() function checkedit(){ var checkedone=false; for (var i=0; i < searchresult_form.elements.length; i++){ if (searchresult_form.elements[i].type == 'checkbox'){ if (searchresult_form.elements[i].checked == true) { checkedone=true; break; } } } if(!checkedone) { alert('Please select the lead'); return false; } document.searchresult_form.submit(); }//checkedit function changeback(form) { for(var i=0;i< form.selstate.options.length;i++) { if(form.selstate.options[i].selected) { var st=new String(form.selstate.options[i].value); var s=st.split('|'); } } var url=s[0]; var state=s[1]; //alert(url); if(state != 0) { //document.location.href="state_specific/getquote.php?leadstate="+state; var url1="http://www." + url + "/state_specific/getquote.php?leadstate="+state; document.location.href=url1; }//if }//changeback() function validate_username() { if(document.username_form.change_username.value=="") { alert("Please enter the username"); document.username_form.change_username.focus(); return false; } return true; }//validate_username function validate_password() { if(document.password_form.change_password.value=="") { alert("Please enter the password"); document.password_form.change_password.focus(); return false; } if(document.password_form.retype_password.value=="") { alert("Please enter the retype password"); document.password_form.retype_password.focus(); return false; } if(document.password_form.change_password.value != document.password_form.retype_password.value ) { alert("Please enter the correct retype password"); document.password_form.retype_password.focus(); return false; } return true; }//validate_password function validate_register_form(perform) { if(document.register_form.firstname.value=="") { alert("Please enter the firstname"); document.register_form.firstname.focus(); return false; } if(document.register_form.lastname.value=="") { alert("Please enter the lastname"); document.register_form.lastname.focus(); return false; } if(document.register_form.address.value=="") { alert("Please enter the address"); document.register_form.address.focus(); return false; } if(document.register_form.city.value=="") { alert("Please enter the city"); document.register_form.city.focus(); return false; } if(document.register_form.state.value==0) { alert("Please enter the state"); document.register_form.state.focus(); return false; } if(document.register_form.zip.value=="") { alert("Please enter the zip"); document.register_form.zip.focus(); return false; } if(document.register_form.phone.value=="") { alert("Please enter the phone"); document.register_form.phone.focus(); return false; } if(document.register_form.email.value=="") { alert("Please enter the email"); document.register_form.email.focus(); return false; } if (!validateEmail(document.register_form.email.value)) { alert("Please enter the correct email address like xxx@yyy.zzz"); document.register_form.email.focus(); return false; } if(perform !="Waiting") { if(!(document.register_form.agree.checked)) { alert("Please agree to the signup agreement"); document.register_form.agree.focus(); return false; }//if if(document.register_form.user_name.value=="") { alert("Please enter the username"); document.register_form.user_name.focus(); return false; } if(document.register_form.pass_word.value=="") { alert("Please enter the password"); document.register_form.pass_word.focus(); return false; } }//if return true; }//validate_register_form() function checkccinfo() { if(document.payment_form1.cc_firstname.value=="") { alert("Please enter the card holder's firstname"); document.payment_form1.cc_firstname.focus(); return false; }//if if(document.payment_form1.cc_lastname.value=="") { alert("Please enter the card holder's lastname"); document.payment_form1.cc_lastname.focus(); return false; }//if if(document.payment_form1.cc_number.value=="") { alert("Please enter the credit card number"); document.payment_form1.cc_number.focus(); return false; }//if if(document.payment_form1.cc_expiry.value=="") { alert("Please enter the credit card expiry"); document.payment_form1.cc_expiry.focus(); return false; }//if return true; }//checkccinfo() function checkccinfo1() { if(document.payment_form.cc_firstname.value=="") { alert("Please enter the card holder's firstname"); document.payment_form.cc_firstname.focus(); return false; }//if if(document.payment_form.cc_lastname.value=="") { alert("Please enter the card holder's lastname"); document.payment_form.cc_lastname.focus(); return false; }//if if(document.payment_form.cc_number.value=="") { alert("Please enter the credit card number"); document.payment_form.cc_number.focus(); return false; }//if if (isNaN(document.payment_form.cc_number.value)) {alert("Invalid credit card number. Make sure it doesn't contain any alphabets, spaces Or characters like -,# etc"); document.payment_form.cc_number.focus();return false; } if(document.payment_form.cc_expiry.value=="") { alert("Please enter the credit card expiry"); document.payment_form.cc_expiry.focus(); return false; }//if return true; }//checkccinfo() function verify() { var val=confirm('Are you sure you want to perform the selected action?'); if(val==true) document.searchresult_form.submit(); }//verify function verify1() { var val=confirm('Are you sure you want to perform the selected action?'); if(val==true) document.zone_form.submit(); }//verify1 function validate_VC_form() { if(document.payment_form.agentname.value=="") { alert("Please enter the name"); document.payment_form.agentname.focus(); return false; }//if if(document.payment_form.agentphone.value=="") { alert("Please enter the phone"); document.payment_form.agentphone.focus(); return false; }//if if(document.payment_form.agentemail.value=="") { alert("Please enter the email"); document.payment_form.agentemail.focus(); return false; }//if if(!validateEmail(document.payment_form.agentemail.value)) { alert("Please enter the correct email address as email@email.com"); document.payment_form.agentemail.focus(); return false; }//if if(document.payment_form.agentaddress.value=="") { alert("Please enter the address"); document.payment_form.agentaddress.focus(); return false; }//if if(document.payment_form.agentcity.value=="") { alert("Please enter the city"); document.payment_form.agentcity.focus(); return false; }//if if(document.payment_form.agentzip.value=="") { alert("Please enter the zip"); document.payment_form.agentzip.focus(); return false; }//if if(document.payment_form.amount.value=="") { alert("Please enter the amount"); document.payment_form.amount.focus(); return false; }//if /* if(document.payment_form.amount.value==0) { alert("Amount cannot be zero"); document.payment_form.amount.focus(); return false; }//if */ if(document.payment_form.checknumber.value=="") { alert("Please enter the checknumber"); document.payment_form.checknumber.focus(); return false; }//if if(document.payment_form.routing.value=="") { alert("Please enter the transit routing"); document.payment_form.routing.focus(); return false; }//if if(document.payment_form.accountno.value=="") { alert("Please enter the account number"); document.payment_form.accountno.focus(); return false; }//if return true; }//validate_VC_form function validate_VC_form1() { if(document.payment_form.agentname1.value=="") { alert("Please enter the name"); document.payment_form.agentname1.focus(); return false; }//if if(document.payment_form.agentphone1.value=="") { alert("Please enter the phone"); document.payment_form.agentphone1.focus(); return false; }//if if(document.payment_form.agentemail1.value=="") { alert("Please enter the email"); document.payment_form.agentemail1.focus(); return false; }//if if(!validateEmail(document.payment_form.agentemail1.value)) { alert("Please enter the correct email address as email@email.com"); document.payment_form.agentemail1.focus(); return false; }//if if(document.payment_form.agentaddress1.value=="") { alert("Please enter the address"); document.payment_form.agentaddress1.focus(); return false; }//if if(document.payment_form.agentcity1.value=="") { alert("Please enter the city"); document.payment_form.agentcity1.focus(); return false; }//if if(document.payment_form.agentzip1.value=="") { alert("Please enter the zip"); document.payment_form.agentzip1.focus(); return false; }//if if(document.payment_form.amount1.value=="") { alert("Please enter the amount"); document.payment_form.amount1.focus(); return false; }//if /* if(document.payment_form.amount.value==0) { alert("Amount cannot be zero"); document.payment_form.amount.focus(); return false; }//if */ if(document.payment_form.checknumber.value=="") { alert("Please enter the checknumber"); document.payment_form.checknumber.focus(); return false; }//if if(document.payment_form.routing.value=="") { alert("Please enter the transit routing"); document.payment_form.routing.focus(); return false; }//if if(document.payment_form.accountno.value=="") { alert("Please enter the account number"); document.payment_form.accountno.focus(); return false; }//if return true; }//validate_VC_form1() function validate_editprofile() { frm=document.editprofile_form; if(frm.firstname.value=="") { alert("Please enter the firstname"); frm.firstname.focus(); return false; }//if if(frm.lastname.value=="") { alert("Please enter the lastname"); frm.lastname.focus(); return false; }//if if(frm.address.value=="") { alert("Please enter the address"); frm.address.focus(); return false; }//if if(frm.city.value=="") { alert("Please enter the city"); frm.city.focus(); return false; }//if if(frm.zip.value=="") { alert("Please enter the zip"); frm.zip.focus(); return false; }//if if(frm.phone.value=="") { alert("Please enter the phone"); frm.phone.focus(); return false; }//if if(frm.email.value=="") { alert("Please enter the email"); frm.email.focus(); return false; }//if if (!validateEmail(frm.email.value)) { alert("Please enter the correct email address as email@email.com"); frm.email.focus(); return false; }//if return true; }//validate_editprofile() function validate_editbilling() { frm=document.editbilling_form; if(frm.payment_mode.value == 'CreditCard') { if(frm.card_holder_firstname.value=="") { alert("Please enter the cardholder's firstname"); frm.card_holder_firstname.focus(); return false; }//if if(frm.card_holder_lastname.value=="") { alert("Please enter the cardholder's lastname"); frm.card_holder_lastname.focus(); return false; }//if if(frm.card_number.value=="") { alert("Please enter the card number"); frm.card_number.focus(); return false; }//if if(frm.card_expiry.value=="") { alert("Please enter the card expiry"); frm.card_expiry.focus(); return false; }//if }//if }//validate_editbilling() function validate_check() { frm=document.check_form; if(frm.agentname.value=="") { alert("Please enter the name"); frm.agentname.focus(); return false; }//if if(frm.checknumber.value=="") { alert("Please enter the checknumber"); frm.checknumber.focus(); return false; }//if if(frm.phone.value=="") { alert("Please enter the phone"); frm.phone.focus(); return false; }//if if(frm.email.value=="") { alert("Please enter the email"); frm.email.focus(); return false; }//if if (!validateEmail(frm.email.value)) { alert("Please enter the correct email address as email@email.com"); frm.email.focus(); return false; }//if if(frm.address.value=="") { alert("Please enter the address"); frm.address.focus(); return false; }//if if(frm.city.value=="") { alert("Please enter the city"); frm.city.focus(); return false; }//if if(frm.zip.value=="") { alert("Please enter the zip"); frm.zip.focus(); return false; }//if if(frm.amount.value=="") { alert("Please enter the amount"); frm.amount.focus(); return false; }//if if(frm.amount.value=="0") { alert("Amount cannot be zero"); frm.amount.focus(); return false; }//if if(frm.routing.value=="") { alert("Please enter the routing number"); frm.routing.focus(); return false; }//if if(frm.accountno.value=="") { alert("Please enter the account number"); frm.accountno.focus(); return false; }//if return true; }//validate_check() function validate_renewcc() { frm=document.check_form; if(frm.cc_firstname.value=="") { alert("Please enter the cardholder firstname"); frm.cc_firstname.focus(); return false; }//if if(frm.cc_lastname.value=="") { alert("Please enter the cardholder lastname"); frm.cc_lastname.focus(); return false; }//if if(frm.cc_number.value=="") { alert("Please enter the card number"); frm.cc_number.focus(); return false; }//if if(frm.cc_expiry.value=="") { alert("Please enter the card expiry"); frm.cc_expiry.focus(); return false; }//if return true; }//validate_renewcc()