[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] C::A::ValidateRM


HI,

I'm trying to use field_filters, to pull $'s out of fields for dollar
amounts, as people inevitablly put that in..

It ain't doing it... here is my code..

  if ($self->param('isLoggedIn')) {
    ($results,$err_page) = $self->check_rm('poolcheck::bookPool', {
    required => [qw/fullname address primary_phone workdate am_pm/],
    optional => [qw/secondary_phone email pooltype coveroff accessby
public_comments workdate pending completed confirmed com
bination prebooked blank1 blank1 invoicenum quoted/],
    constraints => {zipcode  => 'zip',
                    primary_phone => 'american_phone',
                    secondary_phone => 'american_phone',
                    email => 'email',

                    workdate => sub { # check to make sure workdate
doesn't precede today
                                      my $val = shift;
                                      my ($y,$m,$d) = split(/-/,$val);
                                      my $pastdate = 0;
                                      $pastdate = 1 if
(Delta_Days($y,$m,$d,Today()) <= 0);
                                      return $pastdate; },
    },
    filters => ['trim'],
    field_filters => { quoted => ['decimal'], },
    msgs => {any_errors => 'err__',
             prefix=>'err_'},
    });
  } 


Any idea's or things i could try ?

Thanks.
-- 
Jeff MacDonald
http://www.halifaxbudolife.ca

---------------------------------------------------------------------
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.