As with all scripting languages there always seems to be many ways of achieving the same result so I picked the most simple and logical methods of validating form fields.
When to do the validating
The usual time and place to validate your form data is when the user has completed a form and is ready to submit that data for processing. Of course there are times when validation needs to take place before the user gets that far but we will cover that later on.
As a general rule, we will perform our validation when submission occurs and either stop the process if part of our validation criteria has not been met or let the process continue if everything is as we want.
So the trigger for our validation event will be on Submission or in VBScript language onSubmit (See how friendly VBScript can be?)