function ValidateForm(theForm) { if (theForm.subtotal.value<10.00) { alert("The Minimum Order is $10.00"); theForm.quantity1.focus(); return (false); } if (theForm.realname.value == "") { alert("Please enter a value for the \"Full Name\" field."); theForm.realname.focus(); return (false); } if (theForm.ADDRESS.value == "") { alert("Please enter a value for the \"Address Line\" field."); theForm.ADDRESS.focus(); return (false); } if (theForm.UID.value == "") { alert("Please enter a value for the \"CID Number\" from your credit card."); theForm.UID.focus(); return (false); } if (theForm.CITY.value == "") { alert("Please enter a value for the \"City\" field."); theForm.CITY.focus(); return (false); } if (theForm.STATE.value == "") { alert("Please enter a value for the \"State\" field."); theForm.STATE.focus(); return (false); } if (theForm.ZIPCODE.value == "") { alert("Please enter a value for the \"Zip Code or Postal Code\" field."); theForm.ZIPCODE.focus(); return (false); } if (theForm.COUNTRY.value == "") { alert("Please enter a value for the \"Country\" field."); theForm.COUNTRY.focus(); return (false); } if (theForm.DAYAREACODE.value == "") { alert("Please enter a value for the daytime area code."); theForm.DAYAREACODE.focus(); return (false); } if (theForm.DAYPHONE.value == "") { alert("Please enter a value for the daytime phone number field."); theForm.DAYPHONE.focus(); return (false); } if (theForm.NIGHTAREACODE.value == "") { alert("Please enter a value for the night time area code field."); theForm.NIGHTAREACODE.focus(); return (false); } if (theForm.NIGHTPHONE.value == "") { alert("Please enter a value for the night time phone number field."); theForm.NIGHTPHONE.focus(); return (false); } if (theForm.email.value == "") { alert("Please enter a value for the \"email\" field."); theForm.email.focus(); return (false); } if (theForm.CREDITNUMBER.value == "") { alert("Please enter a value for the \"Credit Card\" field."); theForm.CREDITNUMBER.focus(); return (false); } if (theForm.CREDITDATE.value == "") { alert("Please enter a value for the \"Credit Card Expiration Date\" field."); theForm.CREDITDATE.focus(); return (false); } if (theForm.quantity1.value == "") { alert("Please enter a value for the \"Quantity\" field."); theForm.quantity1.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity1.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digits in the \"Quantity\" field."); theForm.quantity1.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity2.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity2\" field."); theForm.quantity2.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity3.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity3\" field."); theForm.quantity3.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity4.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity4\" field."); theForm.quantity4.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity5.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity5\" field."); theForm.quantity5.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity6.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity6\" field."); theForm.quantity6.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity7.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity7\" field."); theForm.quantity7.focus(); return (false); } var checkOK = "0123456789 "; var checkStr = theForm.quantity8.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("Please enter only digit characters in the \"quantity8\" field."); theForm.quantity8.focus(); return (false); } var radioSelected = false; for (i = 0; i < theForm.STATETAX.length; i++) { if (theForm.STATETAX[i].checked) radioSelected = true; } if (!radioSelected) { alert("Please select one of the \"California Resident\" options."); return (false); } return (true); }