function validateFields() { var obj = document.form; //================= Validate fields ======================// //check First Name if (obj.field3.value == '') { alert('Please enter a first name.'); obj.field3.focus(); return; } // check Last Name if (obj.field5.value == '') { alert('Please type your last name.'); obj.field5.focus(); return; } // check address if (obj.field7.value == '') { alert('Please enter a address1.'); obj.field7.focus(); return; } //check City /Town if (obj.field9.value == '') { alert('Please enter a city.'); obj.field9.focus(); return; } // check State if (obj.field10.value == '') { alert('Please enter a state.'); obj.field10.focus(); return; } //check Country if (obj.field11.value == '') { alert('Please enter a country.'); obj.field11.focus(); return; } //check Postcode/Zip if (obj.field12.value == '') { alert('Please enter your zipcode.'); obj.field12.focus(); return; } //check Postcode/Zip var ziptmp = obj.field12.value.replace (/\s+/g, ''); obj.field12.value = ziptmp; if ((ziptmp != '') && !(isAlphaNumeric(ziptmp))) { alert('Please enter a valid zipcode.'); obj.field12.focus(); return; } //check Phone if((obj.field13.value !='') && !(isNumeric(obj.field13.value))){ alert('Please enter a valid phone number.'); obj.field13.focus(); return; } // check email var custEmail = obj.field14.value; if (custEmail == '') { alert('Please enter your email address'); obj.field14.focus(); return; } if ((custEmail.indexOf('@') < 0) || ((custEmail.charAt(custEmail.length-4) != '.') && (custEmail.charAt(custEmail.length-3) != '.'))) { alert('Please type a valid email address.'); obj.field14.focus(); return; } makehtxt() } function makehtxt() { var addr = ""; var obj = document.form; addr +=","+obj.field5.value; addr +=","+obj.field7.value; addr +=","+obj.field8.value; addr +=","+obj.field9.value; addr +=","+obj.field10.value; obj.sumlist.value = addr; obj.submit(); } function isNumeric(value) { if (value == null || !value.toString().match(/^[-]?\d*\.?\d*$/)) return false; return true; } function isAlphaNumeric(alphane) { var numaric = alphane; for(var j=0; j 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123)) { } else { return false; } } return true; }