1. Computing

Validating Forms Using Event Handlers

Many web sites still use this old fashioned obtrusive approach to form field validation. Validating forms uses event handlers in the HTML rather than event listeners in the JavaScript is simpler to write at the start but more prone to problems later. Note that the information in this series is still useful even if you are using event listeners as it also covers what types of validation are required for the different types of form field.

Free Weekly Form Validation Class
This free course over eight weeks will take you step by step through some of the more common validations that you may want to perform with Javascript including radio button validation, drop down list validation, and a number of the validations that you may wish to use for the text fields on your form. Also how to attach the validations to both the individual fields and the form submit button.

Introduction to Form Field Validation
What form fields require validation and when should you validate them.

Drop Down List Validation
How to validate that an appropriate entry is selected from a drop down list.

Individual Field Validation
How to link your validation function to the field so that it is validated straight away.

Validate on Submit
How to validate all of the fields on your form immediately prior to the form being submitted.

Cross Field Validation
Sometimes validating each field individually is not enough. Sometimes you need to validate the content of one input field against another.

©2013 About.com. All rights reserved.