Re: [dfv] Data::Formvalidator and JQuery validation
Status: Inactive
Brought to you by:
markjugg
From: Lyle <web...@co...> - 2010-03-18 15:59:59
|
Mark Stosberg wrote: > I think having a profile that can be used on both the client and server > sides is great, and is a goal I have pursued before myself. As a result, > I wrote this piece of glue a few years ago: > > http://search.cpan.org/~markstos/Data-FormValidator-ErrMsgs-JavaScript-1.00/lib/Data/FormValidator/ErrMsgs/JavaScript.pm Ideally I don't want to JS validation to result in a server request. I want it all client side so that the server only get's a request if it's all valid or JS is turned off. >> Since DFV change to use subrefs and closures it wasn't >> possible to get the DFV schema from the Perl profile. > > The old DFV interface made this easier... I Really don't want to use any old, legacy or deprecated interfaces. I want this to be something that work with the newest/best way of doing things. > Is it just coincidental that your result looks like the hashref > interface that's also present for constraints? Yes, but I see the similarity. The new system is better, except that it looses the markers like these, that allowed you to know exactly what constraint the profile pointed to. . > ( One day I'd like to make a lighter, simpler version of DFV that > removes all the extra ways to do the same thing! ) Let's do it! :) DFV has a lot of legacy and bloat now. I found it was a pretty steep learning curve the first time is used it (although I had a LOT of input to validate). I'm sure with all your experience with it you have a fairly good idea in your head of how it should be. If a 'framework' for it could be thrashed out on this list, I'd be happy to work on it with you. After all, it's something I'm working on right now for my software. The priorities I see are:- Pure Perl option Light weight Easy to extend Easy integration with modern client side JS libraries Such that it would be easy for people to write extension for JS libraries like JQuery. Validation Profile -> Perl server side validation -> JQuery extension -> Client side validation -> JS library extension -> Client side validation Rather than try to export the profile as JSON and re-create DFV in JS as was done before. Simply have Perl libraries that directly generate all the JS code. >> Thoughts on this please? I can't see any reasons against this or >> something similar... > > Perhaps Data::Form::Elements would help here... it's an alternate > interface to DFV: > > http://search.cpan.org/dist/Data-Form-Elements/lib/Data/Form/Elements.pm Possibly... But it looks like it'll be limited with the kind of stuff I'm trying to achieve. Lyle |