[dancer-users] form validation

Sam Batschelet sbatschelet at mac.com
Fri Aug 7 01:03:40 BST 2015


> On Aug 6, 2015, at 1:12 PM, Richard Reina <gatorreina at gmail.com> wrote:
> 
> I am trying to do some basic field validation with Dancer-Plugin-FormValidator. So far I like it but I am a bit confused as to how to write rules in the profile file.
> 
> This for example works great for telling me that the required fields are filled out:
> 
>  profile_sponsor => {
>              'required' => [ qw(
>                  FName LName Email
>               )],
>               msgs => {
>                 missing => 'is missing. Go back and try again.',
>               }
>          },
> 
> 
> But I would like to be able to run some simple checks. Like whether a new users two passwords match and whether, email field contains an email address, and a password choice is long enough, etc. Can this be done easily with this plugin and if so can anyone give some examples?

I like Data::Transpose for form validation it has a lot of good stuff including password policy email format validation. http://search.cpan.org/dist/Data-Transpose/ some decent examples in the POD.  Let me know if you have any questions.

-Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150806/b8ae2949/attachment.sig>


More information about the dancer-users mailing list