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? Thanks
2015-08-06 20:12 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
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?
As this plugin is based on Data::FormValidator, you may find lot of examples from it's documentation. Maybe this is the relevant part: https://metacpan.org/pod/Data::FormValidator#dependencies -- Wbr, Kõike hääd, Gunnar
Hi WK, Thanks for the idea. I looked at that plugin first and it seemed a bit complicated and since I could not find any examples I opted for Dancer FormValidator -- which seemed simpler. One thing I am noticing is that dancer has a ton of plugins but not a whole lot of documentation with examples for newbies like me. Thanks nonetheless for your suggestion. I will try again to figure aout DataFormValidator. 2015-08-06 14:28 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-06 20:12 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
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?
As this plugin is based on Data::FormValidator, you may find lot of examples from it's documentation. Maybe this is the relevant part: https://metacpan.org/pod/Data::FormValidator#dependencies
-- Wbr, Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On 2015-08-06 17:23, Richard Reina wrote:
One thing I am noticing is that dancer has a ton of plugins but not a whole lot of documentation with examples for newbies like me.
I recommend you look on GitHub.com. Search for your plug-in's name among the repositories, then dig inside that to look for the "examples" directory, if there is one. I won't say this is a cure-all but it's usually better than nothing. -- Jeff Boes <>< jeff@endpoint.com (269) 408-0811
Hi Jeff, Will do. Thanks for the idea. So far I am just writing my own validation into a subroutine that I plan to turn into a module later on. Thanks 2015-08-19 9:49 GMT-05:00 Jeff Boes <jeff@endpoint.com>:
On 2015-08-06 17:23, Richard Reina wrote:
One thing I am noticing is that dancer has a ton of plugins but not a whole lot of documentation with examples for newbies like me.
I recommend you look on GitHub.com. Search for your plug-in's name among the repositories, then dig inside that to look for the "examples" directory, if there is one.
I won't say this is a cure-all but it's usually better than nothing.
-- Jeff Boes <>< jeff@endpoint.com (269) 408-0811
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
On Aug 6, 2015, at 1:12 PM, Richard Reina <gatorreina@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
Thanks will check out data transpose. 2015-08-06 19:03 GMT-05:00 Sam Batschelet <sbatschelet@mac.com>:
On Aug 6, 2015, at 1:12 PM, Richard Reina <gatorreina@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
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (4)
-
Jeff Boes -
Richard Reina -
Sam Batschelet -
WK