The code I want to talk about here is of my own creation. I'll be the first to admit that "I am not a developer", and so the code itself may not be technically perfect, for this I make little apologies.
In reality the minimum code requirements for any page containing a form would look a little bit like this:
Take notice of the lack of any reference to HTML object names or ids, the code is entirely generic, all we are doing is instantiating the class.
The types of validation for form elements themselves are set within the form elements tag with the simple addition of some attributes such as
validate, valmand, valmin, valmax etc.
Any number of compatible commands can be used in combination, e.g. a text field which is mandatory and has a minimum and maximum character length could be defined as such:
<input type=text validate valmin=5 valmax=15>
The consequence of this should be obvious but do note the lack of any scripting or complex syntax.
Feel free to play.