JavaScript/DHTML Form Validation Exercise

1. Create a form that includes 2 textboxes (one for name, one for email address), a textarea, a dropdown box (<select> tag), a set of radio buttons, a set of checkboxes, and a button that submits the form input and a button that clears it.  Format the form using a table.  The ACTION attribute of the form tag should be to email the form results to your email address.  If you have created a form in another class or in another homework assignment, feel free to use that form here. (4)

2. Add a JavaScript event handler to the form to determine whether the user input on the form is valid in the following ways.  Feel free to do add additional criteria.  Form validation should occur when the user clicks the  button to submit the user input.  

a) Validate that an entry has been made in each form element - textbox, textarea, dropdown box , radio buttons, checkboxes

3. If the user input for a particular form element fails the test in part 2, display a message in red text in the page (not a separate window) indicating the problem. When the user clicks the submit button, all the deficiencies in the form should be displayed.  Make your code work in Internet Explorer 4 and 5,  Netscape 4.7, and Netscape 6 (this will require 3 different DHTML codings).  If there are deficiencies in the form, the form input should not be emailed. 

4. If the user changes the form input and clicks the submit button again, the validation described in part two above should occur again, with only the remaining deficiencies displayed. 

Form validation is one of the most common uses of JavaScript.  The reason we didn't do this earlier is that displaying the deficiencies in the form can be done better with DHTML than without it.  This assignment will require a fair amount of coding.