On 2004-10-11, Dan Horne <[EMAIL PROTECTED]> wrote:
>
> I just asked the question about matching passwords last week on the
> Data::FormValidator list (Thanks, Mark, for the solution).

You're welcome. :) Generally the Data::FormValidator list is the
preferred list to ask questions about ValidateRM, but there seem to be
plently of helpful people here, too. 

>         optional => [qw(user_id)],
>         constraints => {
>             password1 => {
>                 name => 'invalid_password1',
>                 constraint => \&_check_pass,
>                 params => ['password1']
>             },
>             password2 => {
>                 name => 'invalid_password2',
>                 constraint => \&_check_pass,
>                 params => ['password2']
>             },
>             password1 => {
>                 name => 'confirm',
>                 constraint => sub {
>                     my $password1 = shift;
>                     my $password2 = shift;
>                     return ($password1 eq $password2);
>                 },
>                 params => [qw(password1 password2)]
>             },
>         },

DFV also supports multiple constraints on a single file. If my memory
serves, this should work:

 password1 =>  [
         {
                 name => 'invalid_password1',
                 constraint => \&_check_pass,
                 params => ['password1']
         },
         {
                 name => 'confirm',
                 constraint => sub {
                         my $password1 = shift;
                         my $password2 = shift;
                         return ($password1 eq $password2);
                 },
                 params => [qw(password1 password2)]
         },
 ],

        Mark


-- 
http://mark.stosberg.com/ 


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to