HI All

I have a html form which has two date fields - datefrom & dateto. I am using CGI::Application::ValidateRM to validate form to make sure that users have entered dates. This is working fine.

Problem is I am not able to force user to enter datefrom < dateto, which is important. I can get around this by using sql and then reload the page all over again but I want to avoid it. Using Date::Calc->Delta_Days I am able to calculate total no of days, either +tive or -tive. However I am not able to fit this into profile of the page. At the moment my check_rm profile read like this

my ($results,$err_page) = $self->check_rm('holidayRequest',{ required => ['holidayfrom','holidayto'], optional => ['usercomments'], filters => ['trim'], msgs=>{ any_errors => 'err__', prefix=>'err_', }, }); return $err_page if $err_page;

Thanks in advance for your help


In reply to Dates and formvalidation by bar10der

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.