var USStates = new Array(51) USStates[0] = "ALABAMA" USStates[1] = "ALASKA" USStates[2] = "ARIZONA" USStates[3] = "ARKANSAS" USStates[4] = "CALIFORNIA" USStates[5] = "COLORADO" USStates[6] = "CONNECTICUT" USStates[7] = "DELAWARE" USStates[8] = "DISTRICT OF COLUMBIA" USStates[9] = "FLORIDA" USStates[10] = "GEORGIA" USStates[11] = "HAWAII" USStates[12] = "IDAHO" USStates[13] = "ILLINOIS" USStates[14] = "INDIANA" USStates[15] = "IOWA" USStates[16] = "KANSAS" USStates[17] = "KENTUCKY" USStates[18] = "LOUISIANA" USStates[19] = "MAINE" USStates[20] = "MARYLAND" USStates[21] = "MASSACHUSETTS" USStates[22] = "MICHIGAN" USStates[23] = "MINNESOTA" USStates[24] = "MISSISSIPPI" USStates[25] = "MISSOURI" USStates[26] = "MONTANA" USStates[27] = "NEBRASKA" USStates[28] = "NEVADA" USStates[29] = "NEW HAMPSHIRE" USStates[30] = "NEW JERSEY" USStates[31] = "NEW MEXICO" USStates[32] = "NEW YORK" USStates[33] = "NORTH CAROLINA" USStates[34] = "NORTH DAKOTA" USStates[35] = "OHIO" USStates[36] = "OKLAHOMA" USStates[37] = "OREGON" USStates[38] = "PENNSYLVANIA" USStates[39] = "RHODE ISLAND" USStates[40] = "SOUTH CAROLINA" USStates[41] = "SOUTH DAKOTA" USStates[42] = "TENNESSEE" USStates[43] = "TEXAS" USStates[44] = "UTAH" USStates[45] = "VERMONT" USStates[46] = "VIRGINIA" USStates[47] = "WASHINGTON" USStates[48] = "WEST VIRGINIA" USStates[49] = "WISCONSIN" USStates[50] = "WYOMING" function validateUSState( state ) { var currentState = state.toUpperCase() ; var check = false; for(i=0;i<=USStates.length-1;i++) { if (currentState == USStates[i] ) { check = true; } } return check } function prim_database(value1,value2) { var ckCount = 0; for(var i = 0 ; i < 8; i++) { if((i<=value1.length-2)&&(value1[i].checked)) { ckCount=ckCount+1; value2.disabled=true; } if((i==value1.length-1)&&(value2.value.length==0)&&(ckCount == 0)) { return false; } else if(i==value1.length-1) return true; }; } function primary_database(value1) { var ckCount = 0; var flag=false; for(var i = 0 ; i < value1.length; i++) { if(value1[i].checked) { flag=true; } /*if((i<=value1.length-2)&&(value1[i].checked)) { ckCount=ckCount+1; value2.disabled=true; } if((i==value1.length-1)&&(value2.value.length==0)&&(ckCount == 0)) { return false; } else if(i==value1.length-1) return true;*/ } return flag; } function webserver(checkvalue,fieldvalue) { var ckCount4 = 0; if((checkvalue[0].checked)) if(fieldvalue.value.length==0) return false; /* if((checkvalue[1].checked)) if(fieldvalue.value.length > 0) return false; */ if(!(checkvalue[0].checked)&&!(checkvalue[1].checked)) return false else return true; } function isValidDate(day,month,year) { var jsday = day.options[day.options.selectedIndex].value; var jsmonth = month.options[month.options.selectedIndex].value; var jsyear = year.options[year.options.selectedIndex].value; if (jsmonth==2) { if (jsday>29) return (false); if (jsday>28 & (jsyear%4)!=0) return (false); } if (jsmonth==4 || jsmonth==6 || jsmonth==9 || jsmonth==11) { if (jsday>30) return (false); } return (true); } function isEmpty2(theEntry) { alert("with in the script"+theEntry.value); if(theEntry.value=="") { return (false) } else { return (true); } } function isEmpty(theEntry) { // Note : returns true if theEntry has (if no chars typed, white spaces typed, zero typed) // Language : JavaScript // accepts : content of a textField // returns : boolean (true , false) // does : checks whether the given input // box is empty // Returns true if string s is empty or // whitespace characters only. // whitespace characters var whitespace = " \b\t\n\r"; theInput = theEntry.value; theLength = theEntry.value.length; var startwhitespace=0; var endwhitespace=0; for (var i = 0; i < theLength ; i++) { var theChar = theInput.charAt(i); if (whitespace.indexOf(theChar) !== -1) startwhitespace++; else break; }//for loop ends for(var i=theLength-1;i>=0 ;i--) { var theChar = theInput.charAt(i); if (whitespace.indexOf(theChar) !== -1) endwhitespace++; else break; } theInput = theInput.substring(startwhitespace,(theLength-endwhitespace)); theLength=theLength-startwhitespace-endwhitespace; // Is the text field empty? if((theInput == null) || (theLength == 0) || (theInput == 0)) { return (true); } // Search through string's characters one by one // until we find a non-whitespace character. // When we do, return false; if we don't, return true. for (var i = 0; i < theLength ; i++) { // Check that current character isn't whitespace. var theChar = theInput.charAt(i); if (whitespace.indexOf(theChar) == -1) { return (false); } }//for loop ends // All characters are whitespace. return (true); }// function isEmpty ends function validChar(theEntry) { validStartChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; validEndChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789."; validInnerChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-.&/"; theInput = theEntry.value; theLength = theEntry.value.length; theStartChar = theInput.charAt(0); theEndChar = theInput.charAt(theLength-1); if(validStartChar.indexOf(theStartChar) == -1) { if(theStartChar == " ") theStartChar = "Space"; // alert(theStartChar+" not allowed at the Start."); alert("Please Enter Correct Value"); return (false); } if(validEndChar.indexOf(theEndChar) == -1) { if(theEndChar == " ") theEndChar = "Space"; // alert(theEndChar+" not allowed at the End."); alert("Please Enter Correct Value"); return (false); } for(var i=0;i 1) return (false); if(theInput.indexOf(".",theInput.indexOf("@")+2) == -1) return (false); if(theInput.charAt(theInput.indexOf("@")-1) == ".") return (false); if(theInput.charAt(theInput.indexOf("@")+1) == ".") return (false); if(theInput.charAt(theInput.indexOf(".")+1) == ".") return (false); for(var i = 0;i="0")&&(val.charAt(i)<="9")) { if(i==val.length-1) return (true); } else { return (false); } } } function validstate(state,other) { var ind = state.indexOf("*"); state = state.substring(0,ind); if((state.length==0)&&(other.length==0)) { return (false); } else { return (true); } } function validemptystate(state) { var ind = state.indexOf("*"); state = state.substring(0,ind); if(state.length==0) { return (false); } else { return (true); } } function statevalidate(state,country) { if((country == "UNITED STATES") || (country == "Canada")) { if(state.length==0) { return (false); } else { return (true); } } return (true); } function valstate() { if(document.user.Country[document.user.Country.selectedIndex].value == "UNITED STATES") { var x = document.user.state[document.user.state.selectedIndex].value; if ((x.length==0)||(validateUSState(x)==false)) { return(false); } else { return(true); } } } function validstate2(state,other) { var ind = state.indexOf("*"); state = state.substring(0,ind); if((state.length!=0)&&(other.length!=0)) { return (false); } else { return (true); } } function validstate3(state,country) { var ind = state.indexOf("*"); state = state.substring(0,ind); if(state.length != 0) { if((country == "UNITED STATES") || (country == "Canada")) { return (true); } else { return (false); } } else { return (true); } } function appdevenv(apdev,apdev2,apdevother) { if(apdev.checked == false && apdev2.checked == false && apdevother.value.length==0) { return (false); } else { return (true); } } function repprod(checkvalue,fieldvalue) { if(!(checkvalue[0].checked)) { if(fieldvalue.value.length!=0) { if((checkvalue[1].checked)) if(fieldvalue.value.length==0) return (false); } if((checkvalue[2].checked)) if(fieldvalue.value.length > 0) return (false); if(!(checkvalue[1].checked)&&!(checkvalue[2].checked)) return (false); } else return (true); } function repprod2(checkvalue,fieldvalue) { if((checkvalue[0].checked)&&(fieldvalue.value.length==0)) return (false) else return (true); } function busintell(checkvalue) { if((!(checkvalue[0].checked))&&(!(checkvalue[1].checked))) { return (false); } else return (true); } function busintell2(checkvalue,checkvalue1,checkvalue2,checkvalue3,checkvalue4,checkvalue5,checkvalue6,checkvalue7) { if(checkvalue[0].checked) { if(!checkvalue1.checked && !checkvalue2.checked && !checkvalue3.checked && !checkvalue4.checked && !checkvalue5.checked && !checkvalue6.checked) { return (false); } else { if((checkvalue6.checked)&&(checkvalue7.value=="")) { return (false); } else { return (true); } } } else { /* if(checkvalue1.checked || checkvalue2.checked || checkvalue3.checked || checkvalue4.checked || checkvalue5.checked || checkvalue6.checked || checkvalue7.value.length>0) { return (false); } else { */ return (true); // } } } function validstate5(val1,val2) { var ind1; var id; if(val1.length != 0) { if(val2 == "Canada") { id = "21"; } if(val2 == "UNITED STATES") { id = "2"; } ind = val1.indexOf("*"); var str = val1.substring(ind+1,val1.length); if((id == "21")||(id == "2")) { if(str==id) return (true) else return (false); } else { return (true); } } else { return (true); } } function validstate6(other,country) { if(other.length > 0) { if((country =="UNITED STATES") || (country == "Canada")) { return (false); } else return (true); } else return (true); } function validboxes(val1,val2) { if(val1.checked==true) { val2.disabled=true; } } function validallboxes(val1,val2,val3,val4,val5,val6,val7,val8) { if(val1.checked==true) { val2.disabled=true; val3.disabled=true; val4.disabled=true; val5.disabled=true; val6.disabled=true; val7.disabled=true; val8.disabled=true; } } function invertvalidboxes(val1,val2) { if(val1.checked==true) { val2.disabled=false; } } function invertvalidallboxes(val1,val2,val3,val4,val5,val6,val7,val8) { if(val1.checked==true) { val2.disabled=false; val3.disabled=false; val4.disabled=false; val5.disabled=false; val6.disabled=false; val7.disabled=false; val8.disabled=false; } }