Joomla 1.5 contains a behavior JHTMLBehavior::formvalidation() which enables the script validate.js. It uses mootools (I think) and allows your form and its elements to be validated. The only thing you have to do is set the classes of the form to specified meanings such as
I believe the only thing to do is set the class "form-validate" to the form.
How to do this? Is this done by giving a token to the script receving the form?