Really Simple Validation (RSV)
I've used a number of different validation scripts and generally speaking, they all do the job pretty well. Let's face it: jsut about any validation script provides enough functionality to validate a form - so it seems like it really doesn't matter what you use. Validating email addresses, checking required fields, checking digits only - those sort of tests are included in any validation script worth its mettle.
But every once in a while you need something custom. Maybe you need to validation a form field in some unusual way or you need more control over how the errors are presented, or you need to pass off control to your own function on form submit - whatever. That's where RSV really shines. There's nothing worse than spending time implementing a script, only to find out it doesn't work for one particular case. Having to find and learn another script can be a royal headache. Well, RSV is the end product of all those headaches. Over the years I've continually improved it to allow for those nasty fringe cases so that in its current incarnation it pretty much handles anything you throw at it.
Here's some of the more powerful aspects of the script:
- It allows you to apply multiple validation rules to the same field
- Allows for simple conditional logic (if field A == something, validation fields B, C and D)
- You can make up your own validation rules
- you can display the errors in literally any way you want, with 3 built-in standard ways to present them and the option to pass the errors to a custom error handler
- Lets you pass off control flow to your own onCompleteHandler function
- there's a PHP sister script available. You can literally copy & paste your validation rules to a PHP file to get server-side validation.
The last one in particular can greatly cut down on development time for you PHP developers out there. Once you wrap your head around the syntax, you can - quite literally - copy and paste the validation rules from JS to PHP (of vice-versa) providing both server- and client-side validation.








