Okay, I'm not very good at programming language but I do understand the basics. I am trying to create a form validation using Javascript. If you have an alternative solution to form validation please share. Otherwise, below is what I have setup thus far...it works but it doesn't validate all the fields....any help is appreciated The Javascript I used was taken from the W3schools website on the Javascript Validation tutorial.This is the Javascript Sheet
// JavaScript Document<!--function validate_required(field,alerttxt){with (field){if (value==null||value=="") {alert(alerttxt);return false}else {return true}}}function validatesecurity_required(field,alerttxt){with (field){if (value==null||value=="red white blue") {return true}else {alert(alerttxt);return false}}}function validateterms_required(field,alerttxt){with (field){if (value==null||checked=="") {alert(alerttxt);return false}else {return true}}}//--><!--function validate_form(thisform){with (thisform){if (validate_required(Full_Name,"Full Name must be filled out!")==false) {Full_Name.focus();return false}}}function validate_form(thisform){with (thisform){if (validate_required(Area_Code,"You must provide an Area Code!")==false) {Area_Code.focus();return false}}}function validate_form(thisform){with (thisform){if (validate_required(First_Phone,"You must provide a complete Phone Number!")==false) {First_Phone.focus();return false}}}function validate_form(thisform){with (thisform){if (validate_required(Second_Phone,"You must provide a complete Phone Number!")==false) {First_Phone.focus();return false}}}function validate_form(thisform){with (thisform){if (validatesecurity_required(Security_Question,"You provided the wrong answer to the Security Question. If you have any questions or continue to have problems please contact the webmaster.")==false) {Security_Question.focus();return false}}}function validate_form(thisform){with (thisform){if (validateterms_required(Terms_Agreement,"You must agree to the Terms of Use and Privacy Policy!")==false) {Terms_Agreement.focus();return false}}}//-->
This is the HTML Form page
<form name="contact_form" action="http://lklp.org/v-cgi/forms.cgi" enctype="application/x-www-form-urlencoded" method="post" onSubmit="return validate_form (this);"> <fieldset> <legend>Contact Information</legend> <label>* Name</label> <input type="text" name="Full_Name" size="30"/><br><br> <label>Email</label> <input type="text" name="Email_Address" size="30"/><br><br> <label>* Phone</label> <input type="text" name="Area_Code" size="6" /> <strong><label>-</label></strong> <input type="text" name="First_Phone" size="6" /> <strong><label>-</label></strong> <input type="text" name="Second_Phone" size="8" /><br><br> <label>Alternate Phone</label> <input type="text" name="Alt_Area_Code" size="6" /> <strong>-</strong> <input type="text" name="Alt_Phone" size="6" /> <strong>-</strong> <input type="text" name="Alt_Phone_2" size="8" /><br><br> </fieldset> <br> <fieldset> <legend>Where did you here about us? (Optional)</legend> <select name="Hear_About_Us" size="1"> <option value=""></option> <option value="Friend">Friend</option> <option value="LKLP Representative">LKLP Representative</option> <option value="Online Search Engine">Online Search Engine</option> <option value="Another Organization">Another Organization</option> <option value="Other">Other</option> </select><br><br> <label>If Other:</label> <input type="text" name="Other" size="30" /> </fieldset> <br> <fieldset> <legend>Comments/Questions (Optional)</legend> <textarea name="Comments_Questions" rows="20" cols="40"></textarea> </fieldset> <br> <fieldset> <legend>Security Question *</legend> <label>What colors are the American Flag?</label> <br> <span id="footnotes">(Type all three colors only, include spaces between each word, lower case letters, and NO Commas.)</span> <br> <input type="text" name="Security_Question" size="30" /> </fieldset> <br> <div>Please Read Before You Press Submit:</div> <div> <p>In order to process complaints against LKLP, LKLP Employees, or anything/anyone affiliated with LKLP you must use the <a href="admin/complaintform.htm">Online Complaint Form</a>.</p> <p>All information provided via this online contact form is not 100% secure from third party viewing; however, any information submitted to any LKLP employee via any online form will be kept strictly confidential and will not be shared with anyone. Please visit our <a href="privacy.htm" target="_blank">Privacy Policy</a> and <a href="terms.htm" target="_blank">Terms of Use</a> for more information.</p> <p>You must agree to the Terms of Use and Privacy Policy before you press Submt.<br> </div> <div><input name="Terms_Agreement" type="checkbox" value="I Agree"/> <strong>By checking this box you agree to the <a href="terms.htm">Terms of Use</a> and <a href="privacy.htm">Privacy Policy</a>? * </strong></div> <br><br> <input type="submit" name="Form_Submit" value="Submit Form"/> <input type="reset" name="reset" value="Clear Form"/> <input type="hidden" name="_vDeckformid" value="819" /> </form>