// --------- THIS SECTION VALIDATES FORMS ---------- //substitute document.phoneForm.fieldname.value with appropriate fields function checkResPkg(pkgID){ switch(pkgID.value){ case "CallerID_CallWaiting_star69": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["star69"].checked = false; break; case "CallerID_CallWaiting_star69_MaintenancePlan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["star69"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_MaintenancePlan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_CallFowarding_Maintenance Plan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["callFwd"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardBusy": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdBusy"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardNoAnswer": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdNoAns"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardBusyNoAnswer": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdBusyNoAns"].checked = false; break; }//switch }//function function checkBusPkg(pkgID){ switch(pkgID.value){ case "CallerID_CallWaiting_star69": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["star69"].checked = false; break; case "CallerID_CallWaiting_star69_CallForwarding": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["star69"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_CallForwarding": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_star69_MaintenancePlan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["star69"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_MaintenancePlan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_CallFowarding_MaintenancePlan": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["callFwd"].checked = false; document.phoneForm["maintenance"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardBusy": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdBusy"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardNoAnswer": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdNoAns"].checked = false; break; case "CallerID_CallWaiting_FixedCallForwardBusyNoAnswer": document.phoneForm["callerID"].checked = false; document.phoneForm["callWaiting"].checked = false; document.phoneForm["fixCallFwdBusyNoAns"].checked = false; break; }//switch }//function function checkForm(){ if (document.phoneForm["dlNum"].value == "" && document.phoneForm["ssNum"].value == ""){ alert("Please enter either a Driver's License or Social Security Number."); return false; } /*phoneNum = document.getElementById("serviceNum").value; ssNum1 = document.getElementById("ssNum1").value; ssNum2 = document.getElementById("ssNum2").value;*/ /*phoneNum = document.phoneForm["serviceNum"].value; ssNum1 = document.phoneForm["ssNum"].value; ssNum2 = document.phoneForm["other_ss_num"].value; if (phoneNum != ""){checkPhone(phoneNum);} if (ssNum1 != "") {checkSS(ssNum1);} if (ssNum2 != "") {checkSS(ssNum2);}*/ } function checkPhone(phonestring){ //var phonestring = phonestring.value; var stripped = phonestring.replace(/[\(\)\.\-\ ]/g, '');//strip out acceptable non-numeric characters var i; for(i = 0; i < stripped.length; i++){ // Check that current character is number. var c = stripped.charAt(i); if(((c < "0") || (c > "9"))){ alert("The phone number contains illegal charactiers.\n"); return false; } } if(stripped.length != 10){ alert("The phone number must contain 10 digits.\nMake sure you included an area code (example: 608-555-1212).\n"); return false; } } function checkSS(ssnum){ //var ss = document.phoneForm.ssNum.value; var stripped = ssnum.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters var i; for (i = 0; i < stripped.length; i++){ // Check that current character is number. var c = stripped.charAt(i); if (((c < "0") || (c > "9"))){ alert("The SS number contains illegal charactiers.\n"); return false; } } if (stripped.length != 9) { alert("The SS number is the wrong length.\n"); return false; } }