Form and Spelling Validation - Common Form Validations
(Page 2 of 14 )
When building web applications, it seems that we need to validate the same type of data repeatedly. Rather than recode our functions to do this data checking each time, we should write a set of functions once that cover the most common validations we need to accomplish. Once written, we can reuse these functions in every application we develop where there is a need for these common validation routines.
In this section, we will cover some of the more common form elements we need to validate. Each will be presented as a function that will return TRUE or FALSE depending on the elements validity. Please note that most of the functions presented in this section are specifically coded to examine English input. If you require validation for another language, you will need to modify these functions to suit. The elements we will validate in this section are as follows.
Basic Data CheckingZip/Postal CodesURLsEmail AddressesPassword Strength
After examining each function, we will then build a form with each of the data elements and demonstrate how to validate the data and mark invalid data for re-entry.
Next: >>
More Miscellaneous Articles
More By Matt Wade