Text Field Validation Tutorials
The following articles form a tutorial series introducing you to how to validate text fields with Javascript. The tutorials were written for the http://javascript.about.com/ web site (for which Ask Felgall author Stephen Chapman is now the Guide) and the links below will open the articles directly from that site.
- Mandatory Input
The first in this tutorial series on text field validation shows you how to test that something has been entered.
- Alphabetic and Numeric Validations
Often only a certain range of characters is valid in a field. This tutorial shows you how to test that what is entered is from those valid characters.
- One and Only One
This tutorial covers validating that the field contains at least one of a specified character or only one of a specified character.
- Adjacent Characters
When two (or more) specific characters must always appear together or never appear together you need to validate adjacent characters.
- Only Adjacent
Sometimes some characters must only appear next to certain others but those other characters may also appear separately. This more complicated validation handles this.
- Character Order
Sometimes the characters need to be in a particular order but may (or must) have other characters in between.
- Minimum and Maximum Distance
How to validate that a certain number of characters appear between certain specific ones.
- Starting Values
e that the text string that has been entered starts with one of a set range of values.
- Ending Values
w to validate that the text string that has been entered ends with one of a set range of values.


