Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 82084 invoked from network); 22 Nov 2004 17:39:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 22 Nov 2004 17:39:33 -0000 Received: (qmail 81382 invoked by uid 500); 22 Nov 2004 17:39:26 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 81297 invoked by uid 500); 22 Nov 2004 17:39:25 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 81279 invoked by uid 99); 22 Nov 2004 17:39:24 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [84.96.21.10] (HELO mail.anyware-tech.com) (84.96.21.10) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 22 Nov 2004 09:39:22 -0800 Received: from [10.0.0.27] (unknown [10.0.0.27]) by mail.anyware-tech.com (Postfix) with ESMTP id 6E0445EBA9 for ; Mon, 22 Nov 2004 18:37:43 +0100 (CET) Message-ID: <41A223DF.3090006@apache.org> Date: Mon, 22 Nov 2004 18:37:35 +0100 From: Sylvain Wallez Organization: Anyware Technologies User-Agent: Mozilla Thunderbird 0.9 (Macintosh/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Client side validation References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N [Moving a private email to dev@ as it's really where it should be discussed] Luca Garulli wrote: >Hi, >my customer want a minimal client-side validation for same fields. We >are using CForms and seems to be lack of this feature. > >I'd like to have a single place where to describe validation rules: >the form definition. Anyone has implemented something like a >client-side validation that use the form-definition rules? > >If not I can start to write it. I think that it's a common use case. > > Yes, that's a common use case and we already talked about it but never got the time to implement it. There are different kinds of client-side validation - field presence for required fields - datatype syntax : integer, date, taking the locale-dependent format into account - additional validations. The first item should be easy, and the second one can leverage the datatype information that is already present in a field's XML output (used e.g. to trigger the use of the calendar widget) The third one is trickier, as some validation rules can be controlled on the client (e.g. range, regexp) whereas others can't. What we can do here is adding a generateSAXFragment to validation rules also, so that those rule that can be implemented on the client can produce an XML description that will be translated to JavaScript by the presentation stylesheets. WDYT? -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }