/ Published in: JavaScript
Expand |
Embed | Plain Text
function quickSubmit() { errors = ""; // the nasty error string if (document.contactus.firstName.value == "") { errors += "First Name\n"; //alert(errors); } if (document.contactus.lastName.value == "") { errors+= "Last Name\n"; } if (document.contactus.address1.value == "") { errors+= "Address\n"; } if (document.contactus.city.value == "") { errors+= "City\n"; } if (document.contactus.state.value == "") { errors+= "State\n"; } if (document.contactus.zip.value == "") { errors+= "Zip\n"; } if (document.contactus.phone.value == "") { errors+= "Phone\n"; } if (document.contactus.email.value == "") { errors+= "Email\n"; } if (errors == "") { document.contactus.submit(); } else { alert("Please fill in the following fields:\n" + errors); } }
You need to login to post a comment.
