function validateFormOnSubmit(theForm) { var reason = ""; reason += validateName(theForm.Name); reason += validatePhone(theForm.Phone); reason += validateEmail(theForm.Email); reason += validateMessage(theForm.Message); if (reason != "") { alert("Some fields need correction:\n" + reason); return false; } } function validateEmpty(fld) { var error = ""; if (fld.value.length == 0) { fld.style.background = "#993300"; error = "The required fields have not been filled in.\n" } else { fld.style.background = "#FFFFFF"; } return error; } function trim(s) { return s.replace(/^\s+|\s+$/, ''); } function validateName(fld) { var error = ""; if (fld.value == "") { fld.style.background = "#FF3333"; error = "You didn't enter your name.\n"; } else { fld.style.background = "#FFFFFF"; } return error; } function validatePhone(fld) { var error = ""; var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, ''); if (fld.value == "") { error = "You didn't enter a phone number.\n"; fld.style.background = "#FF3333"; } else { fld.style.background = "FFFFFF"; } return error; } function validateEmail(fld) { var error=""; var tfld = trim(fld.value); // value of field with whitespace trimmed off var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ; var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ; if (fld.value == "") { fld.style.background = "#FF3333"; error = "You didn't enter an email address.\n"; } else if (!emailFilter.test(tfld)) { //test email for illegal characters fld.style.background = "#993300"; error = "Please enter a valid email address.\n"; } else if (fld.value.match(illegalChars)) { fld.style.background = "#993300"; error = "The email address contains illegal characters.\n"; } else { fld.style.background = "FFFFFF"; } return error; } function validateMessage(fld) { var error = ""; if (fld.value == "") { fld.style.background = "#FF3333"; error = "You didn't enter a message.\n"; } else { fld.style.background = "#FFFFFF"; } return error; }
CONTACT USemail: crypto3669[@]gmail.com
Please fill out this Contact Us form.
settlement solutions, fair debt collection, debtors’ rights, unsecured and secured debt resolution, predatory lending and credit repair. | http://educationcenter2000.com | Sitemap | Articles | | Do it Yourself Credit Repair | | About Us | Privacy Policy | Legal | Copyright © All rights reserved.
|