[cgiapp] Unobtrusive Javascript form validation

Ron Savage ron at savage.net.au
Fri Jul 9 20:24:51 EDT 2010


Hi Josh

On Thu, 2010-07-08 at 22:00 -0400, Joshua Miller wrote:
> On Thu, Jul 8, 2010 at 4:35 AM, Richard Jones <ra.jones at dpw.clara.co.uk> wrote:

> Sorry for heading off on a tangent here. I'm a little biased in favor
> of Data.FormValidator, though I'm always interested in seeing what
> other solutions people come up with, and I can readily admit it
> doesn't do everything. For example, it's not good at complex
> validation on the frontend, though I think that'd be possible with
> some updates.

This is not a tangent. Using CGI::App we're all dealing with user input,
surely. And there can't be precisely just one way of doing that.

As for Data::FV, I did use it for years, and I assume many people will
continue to use it for a long time. It does the job.

However, as I've mentioned before - probably on this very list - I think
it's just a bit too complex for it's own good.

This means it's harder than necessary to debug, and/or to log progress
inside it's closure-based methods.

Also, the error formatting I regard as a design fault. It should be
quite separate.

I prefer a elegantly clean design of Data::Verifier, where detecting
errors is separated from formatting them, by virtue of that module doing
just one thing (ie. verification), and doing it wonderfully well.

To labour the point, in one project I had to parse the formatted output
of Data::FV's error msgs, to insert them into another context. That's
when I finally decided to keep a lookout for a replacement. And along
came Data::Verifier!

> The company I work for has also been moving to JQuery, so I won't be
> surprised if Data.FormValidator gets updated at some point to
> integrate better with JQuery, possibly on a fork.

We could discuss endlessly the various merits of JS libraries. I use YUI
for good reason.

Not that it really matters, but I reviewed a few such libs 2 years ago:

http://use.perl.org/~Ron+Savage/journal/37726

Naturally I have no expectations that jQuery fanatics, or any other
fanatics, will switch :-)).

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622



More information about the cgiapp mailing list