[html-formfu] Re: Date Element

Carl Franks fireartist at gmail.com
Mon Aug 6 14:27:53 GMT 2007


On 06/08/07, Tobias Kremer <list at funkreich.de> wrote:
> > Thanks very much. I gave it a spin and it already looks pretty good. Here's
> > some quick feedback.
>
> Some more feedback:
>
> I just realized that invalid dates (e.g. February, 31st) do not trigger an error
> message yet. Furthermore the Required Constraint doesn't work on date Elements.
> It seems to always fail making it impossible to submit the form even with a
> valid date.

How were you testing this?

The file "t/elements/date.t" tests the Required constraint on a date
element - it seems to work ok.

I also found that the program died if an invalid date such as
29/2/2007 were entered - this is now fixed with an eval{} inside
Element/date::process().

In this case, date::process() will set the date value to be the
strftime() value - such as '%d-%m-%Y' - to ensure that there's a true
value to satisfy any Required constraint, and to further ensure the
DateTime inflator will return an error.

Carl



More information about the HTML-FormFu mailing list