John Day wrote:
Hi, I am using CGI::Application::ValidateRM in a webapp and i tmust be too late in teh week for clear thinking. I need to do a check on a cofirmation password. You know, the old signup page that asks you to confirm the password by retyping it. Is there a simple way of doing it within the D::FV profile?
There is an example of how to do exactly that in the docs usingdependency_groups... Make sure you have the latest version if you don't see it in your version:
dependency_groups => {
# if either field is filled in, they all become required
password_group => [qw/password password_confirmation/],
}
You probably also want a constraint that checks to make sure the
passwords are the same:
constraints => {
password => {
# make sure passwords are the same
constraint => sub { $_[0] eq $_[1] },
params => [ qw( password password_confirmation ) ],
},
}
The above constraint is not tested, as I just wrote it from memory, but
you should get the idea...
Cheers,
Cees
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.