31 Jul 2003
In the Simplified Form Errors comments, J. Shell mentions the use of a form validation toolkit.
I’ve evaluated a number of form kits and validators over the years for PHP, Java, ASP, and Perl. They all have fallen short of my expectations and the needs of real-world development. Some of them have faulty validation — letting things through that shouldn’t be or disallowing valid input. Others aren’t flexible enough to allow non-standard inputs. Sometimes I need a rather custom validation like 32 characters, numbers and lowercase letters only, no spaces. And many packages won’t let you inject your own error messages into the error output. For example, just because a username validates doesn’t mean someone can register it. There may already be someone using that name, so I’d need to insert an error that the user needs to pick a different name.
I’d certainly be open to a good form validator, either commercial or open source. Since I’ve recently been doing most of my development in PHP, a PHP form toolkit would be most useful. Any suggestions?
I guess you’re not really into MS. I have done some work using asp.net validators and they were OK for me. The server generated client scripting whenever possible.
The toolkit I mention, “Formulator,” which is a Zope only toolkit, does allow customization of error messages and the ability to call custom validators (ie - calling a script to see if an email address is already registered). With some work, you can write custom widgets and more advanced validators.
It’s only real downfall is that there’s no built in way to do group validation - ie, checking that a ‘password’ and ‘password (validate)’ field contain the same value. You can do such things manually after the form toolkit has done its field by field validation, but it would be nice to have it plugged in to the same validation framework.
But that’s a good set of evaluation points:
If you are looking for a PHP solution, take a look at PEAR. (http://pear.php.net). They have a library that allows you to create and validate forms more efficiently:
http://pear.php.net/manual/en/package.html.html-quickform.php
An alternative which I’ve been using is this form validation class that you can find here:
http://www.phpclasses.org/browse.html/package/1.html
Hope this helps.
The link to Adam Kalsey’s form validator (http://www.x-code.com/vdaemonwebform_validation.php ) does not work!!
In your simple validation form, how would you do the same for a list, field? Thanks.
Fred.
This discussion has been closed.
Adam Kalsey
Mobile: 916.600.2497
Email: adam AT kalsey.com
AIM or Skype: akalsey
©1999-2008 Adam Kalsey.
Content management by Movable Type.
July 31, 2003 9:56 AM
In doing a bit of poking around I came across VDaemon at http://www.x-code.com/vdaemonwebform_validation.php which looks interesting. I’ll try it out and report back.
One concern is that it’s GPL. While I can include and distribute the code in my applications, I’ll need to add the GPL license to the form validation portions. And some clients might not like the idea of having part of their application licensed under the GPL.