Form Validation, Part 1

Quite some time ago, I started wondering about a nice way to do server side form validation. After pondering about what sort of features I wanted, I started to write them down on paper.

These were the features that I came up with:

  • Visual clues that something is in error (background colour/border/..)
  • Various data types for input boxes (int/float/string/alpha/..)
  • Data type restrictions within a data type (min-value/max-value for an int for instance)
  • To generate a list of validation errors and prompts after submitting
  • Different submission requirements for different fields (mandatory/optional)

With that in mind, I started writing it in ASP Classic as a learning tool. I’ll post the Class as a file to download and some explanations of it shortly.