function RequestID(form){ var missing = ""; //Sets up one long string to display all errors at once. var retVal=true; //Variable that is used to see if the form should be submitted. Changes to //false if there are any errors. var j = 0; if(form.RegFName.value == "") { missing = missing + "First Name \n"; j++; if (j == 1) {gotofld=form.RegFName} } if(form.RegLName.value == "") { missing = missing + "Last Name \n"; j++; if (j == 1) {gotofld=form.RegLName} } if(form.BusEmail.value == "") { missing = missing + "Business EMail Address\n"; j++; if (j == 1) {gotofld=form.BusEmail} } else { if(form.BusEmail.value.indexOf("@")==-1) { missing = missing + "EMail Address is incorrect. (i.e. username@domainname.com) \n"; j++; if (j == 1) {gotofld=form.BusEmail} } } if(form.BusPhone.value == "") { missing = missing + "Business Phone \n"; j++; if (j == 1) {gotofld=form.BusPhone} } if(form.pagesw.value == "1") { // the following fields are not always available if(form.actuserid.value == "") { missing = missing + "Log-in ID \n"; j++; if (j == 1) {gotofld=form.actuserid} } if(form.NewPassword.value == "") { missing = missing + "Password \n"; j++; if (j == 1) {gotofld=form.NewPassword} }else{ if(form.NewPassword.value.length < 7){missing = missing + "Password must be at least 7 characters \n"}; var pw1 = form.NewPassword.value.toLowerCase(); if(pw1 == "password" | pw1 == "changeme"){missing = missing + "Password is invalid\n"}; if (form.actuserid != null){ if(form.NewPassword.value == form.actuserid.value){missing = missing + "Password can not match the UserID \n"} } if(missing != ""){ j++; if (j == 1) {gotofld=form.NewPassword} } } // end else } if (!form.CCExpMM.options[0].selected && !form.CCExpYr.options[0].selected) { var thisdte = form.ccdate.value if(isexpng("2",thisdte,form.CCExpMM.options[form.CCExpMM.selectedIndex].text,"00",form.CCExpYr.options[form.CCExpYr.selectedIndex].text)) { missing = missing +"Invalid Credit Card Expiration Date\n" j++; if (j == 1) {gotofld=form.CCExpMM} } } if (form.CCNumber.value != "") { if (!form.CCCompName.options[0].selected) { if(cChk(form.CCCompName.options[form.CCCompName.selectedIndex].text,form.CCNumber.value)) { missing = missing + "Check Credit Card Number\n" j++; if (j == 1) {gotofld=form.CCNumber} } } else{ missing = missing + "Credit Card Company\n" j++; if (j == 1) {gotofld=form.CCCompName} } } if(form.pagesw.value == "2"){ if(form.ComCompSiteName.value == "") { missing = missing + "Company Name \n"; j++; if (j == 1) {gotofld=form.ComCompSiteName} } if(form.ComAddress1.value == "") { missing = missing + "Company Street Address \n"; j++; if (j == 1) {gotofld=form.ComAddress1} } if(form.ComCity.value == "") { missing = missing + "Company City \n"; j++; if (j == 1) {gotofld=form.ComCity} } if (form.ComState.options[0].selected) { if (form.ComProvince.value =="") { missing = missing +"State or Province\n" j++; if (j == 1) {gotofld=form.ComState} } } if(form.ComPostalCode.value == "") { missing = missing + "Company Postal Code \n"; j++; if (j == 1) {gotofld=form.ComPostalCode} } if(form.ComCountry.value == "") { missing = missing + "Company Country \n"; j++; if (j == 1) {gotofld=form.ComCountry} } if(form.ISISBCode.value == ""){ if (form.CCExpMM.options[0].selected || form.CCExpYr.options[0].selected){ missing = missing + "Credit Card Expiration Date \n"; j++; if (j == 1) {gotofld=form.CCExpMM} } if(form.CCNumber.value == "") { missing = missing + "Credit Card Number \n"; j++; if (j == 1) {gotofld=form.CCNumber} } if(form.CCNameOnCard.value == "") { missing = missing + "Name On Credit Card \n"; j++; if (j == 1) {gotofld=form.CCNameOnCard} } } } // "2" if (j == 0) { form.JSLotus.value = "1"; return true; } else{ form.JSLotus.value = "0"; missing="The following fields are required:\n\n" + missing; alert (missing); gotofld.focus(); return false; } } //Function for checking expiration dates base on the current date. function isexpng(tot2chk,dte2chk,expdtem,expdted,expdtey){ // check date against current date var dtestr = expdtey + expdtem if(tot2chk == "3") { dtestr = dtestr + expdted if(dte2chk > dtestr) {return true} } if(tot2chk == "2") { if(dte2chk > dtestr) {return true} } if(tot2chk == "1") // ("1","00",mm/dd/yyyy,mm2/dd2/yyyy2,"00") { var begdte = expdtem.substring(6,4) + expdtem.substring(0,6) var enddte = expdted.substring(6,4) + expdted.substring(0,6) if (begdte > enddte) {return true} } return false // this is good } function cChk(cctype,ccnum){ var numlist = "0123456789"; var sep = "-"; var totnums = 0; var chkerr = 0; var ccnuml = ccnum.length; for (i=0; i 0) {return true} if(cctype == "MasterCard") { var begnum = ccnum.substring(0,2) if(begnum < "51" || begnum > "55") {chkerr++} if(totnums != 16) {chkerr++} } if(chkerr > 0) {return true} if(cctype == "Visa") { if(ccnum.charAt(0) != "4") {chkerr++} if(totnums != 13 && totnums !=16) {chkerr++} } if(chkerr > 0) {return true} if(cctype =="American Express") { var begnum = ccnum.substring(0,2) if(begnum != "34" && begnum != "37") {chkerr++} if(totnums != 15) {chkerr++} } if(chkerr > 0) {return true} if(cctype =="Diner's Club") { var begnum = ccnum.substring(0,2) if(begnum != "30" && begnum != "36" && begnum != "38") {chkerr++} if(totnums != 14) {chkerr++} } if(chkerr > 0) {return true} if(cctype=="Discover") { var begnum = ccnum.substring(0,4) if(begnum != "6011") {chkerr++} if(totnums != 16) {chkerr++} } if(chkerr > 0) {return true} return false; }