Form validation tools

Freshness Warning
This article is over 8 years old. It's possible that the information you read below isn't current.

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?

Adam Kalsey
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.

Bart Vermeersch
July 31, 2003 10:55 AM

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.

J.Shell
July 31, 2003 11:03 AM

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:

  • Customization of error messages for different validation failings
  • Custom validation (ie - calling a script or function that returns ‘true’ or ‘false’)
  • Multi-field validation

Ralph Guzman
August 7, 2003 12:38 AM

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.

Arvis
September 12, 2003 10:10 AM

The link to Adam Kalsey’s form validator (http://www.x-code.com/vdaemonwebform_validation.php ) does not work!!

fred
September 7, 2005 3:21 PM

In your simple validation form, how would you do the same for a list, field? Thanks.

Fred.

This discussion has been closed.

Follow me on Twitter

Lijit Search

Best Of

  • Rounded corners in CSS There lots of ways to create rounded corners with CSS, but they always require lots of complex HTML and CSS. This is simpler.
  • The best of 2006 I wrote a lot of drivel in 2006. Here's the things that are less crappy than the rest.
  • Newly Digital Newly Digital is an experimental writing project. I've asked 11 people to write about their early experiences with computing technology and post their essays on their weblogs. So go read, enjoy, and then contribute. This collection is open to you. Write up your own story, and then let the world know about it.
  • Customer reference questions. Sample questions to ask customer references when choosing a software vendor.
  • Simplified Form Errors One of the most frustrating experiences on the Web is filling out forms. When mistakes are made, the user is often left guessing what they need to correct. We've taken an approach that shows the user in no uncertain terms what needs to be fixed.
  • More of the best »

Recently Read

Get More

Subscribe | Archives

8

Recently

invisible Fence (Mar 22)
The New York Times has a paywall now. Sorta. If you don't choose to ignore it.
Black status icon for Chrometa (Mar 17)
Replacing the status icon of Chrometa
Using Google Voice as your voicemail on AT&T (Oct 26)
How I set up my iPhone to use Google Voice as it's voicemail system.
Don Mattingly forced to make coaching change (Sep 17)
New LA Dodgers coach starts to wonder if he knows the rules of baseball at all.
In which Vonage pretends their prices haven't changed (Apr 12)
Translating what Vonage marketing says about their price increase into plain English.
Twitter app competition (Apr 12)
Life as a Twitter app developer is far from over.
Twitter app competition (Apr 12)
Life as a Twitter app developer is far from over.
The rest of the world is not like you (Apr 5)
Normal people are different. Keep that in mind when creating or marketing a product.

Subscribe to this site's feed.

Elsewhere

IMified
Build instant messaging applications. (My company)
SacStarts
The Sacramento technology startup community.
Pinewood Freak
Pinewood Derby tips and tricks

Contact

Adam Kalsey

Mobile: 916.600.2497

Email: adam AT kalsey.com

AIM or Skype: akalsey

Resume

PGP Key

©1999-2012 Adam Kalsey.
Content management by Movable Type.