Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 14192 invoked from network); 1 Jul 2004 21:46:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Jul 2004 21:46:26 -0000 Received: (qmail 48593 invoked by uid 500); 1 Jul 2004 21:46:26 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 48550 invoked by uid 500); 1 Jul 2004 21:46:25 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 48520 invoked by uid 99); 1 Jul 2004 21:46:24 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 01 Jul 2004 14:46:21 -0700 Received: (qmail 14483 invoked by uid 65534); 1 Jul 2004 21:45:52 -0000 Received: from a183069.studnetz.uni-leipzig.de (EHLO [139.18.183.69]) (139.18.183.69) by mail.gmx.net (mp011) with SMTP; 01 Jul 2004 23:45:52 +0200 X-Authenticated: #3483660 Message-ID: <40E48624.3040500@gmx.de> Date: Thu, 01 Jul 2004 23:46:12 +0200 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: de-de, de, en-us, en-gb, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Validating fd:fields with datatype base="date" References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 01.07.2004 21:13, Colin Paul Adams wrote: > I have a widget defined with a base datatype of date. I have the > calendar pop-up attached so that the user can enter dates easily. > > However, if the users types in a date by hand, and gets it wrong, the > rather unhelpful error message is: > > datatype.conversion faileddatatype.date > > Fine for developers whilst writing the application but ... This should be handled by i18n. When I try the flow sample I get a message "Not a valid date." > Even worse, if the user types in nothing (on a freshly added row), the > form accepts this without complaint (I'm not quite sure why this > should be - I have a pattern convertor and the empty string doesn't > match the pattern - well, I don't think it does: If you do not enter anything no convertor is asked. That's an expected behaviour. If you want to make a required field, add required="true". If the behaviour were like you expect it, it would not be possible to leave out a date field. > Anyway, clearly I need a validator so I can give appropriate error > messages. Looking at the documentation, there does not appear to be > one available for date fields. Does that mean I have to write one in > javascript (or will I need to use java?)? No, required="true", the convertor with a pattern and an i18n message should be sufficient. Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org