Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Dates and formvalidation

by bar10der (Beadle)
on Feb 19, 2004 at 11:48 UTC ( #330191=note: print w/replies, xml ) Need Help??


in reply to Dates and formvalidation

Thanks Larsen, I did try to write my own constraint and though it does not give me any error, it does not perform the validation. Here is my code-
my $profile = { required => ['holidayfrom','holidayto'], optional => ['usercomments'], filters => ['trim'], constraints => { hoidayto => { params => [ 'holidayfrom', 'holidayto' ], constraint => sub { my $from = shift; my $to = shift; my ($d1,$m1,$y1) = split("/",$from); my ($d2,$m2,$y2) = split("/",$to); my $Dd = Delta_Days( $y1, $m1, $d1, $y2, $m2, $d2 ); if($Dd < 0){return 1;} return 0; } } }, msgs=>{ any_errors => 'err__', prefix=>'err_', }, };

I am sure I am making some basic mistake. I am fairly new to Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://330191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2021-09-17 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?