cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Guillard <pguill...@citycita.net>
Subject Re: [CForms] - Design question
Date Tue, 26 Jul 2005 13:42:33 GMT
Hi,

For cross widgets validation, you just put a javascript section on top 
of you cform definition file. There you can access all these widgets and 
do comparison. I remember some of CForms samples do this. Otherwise i 
suggest to check the word validation in the mailing list archives.
For question3, i suggest you use CForms+flow, then it's easy to do this 
in flowscript or if you don't like, javaflow.

Phil

Johannes Becker wrote:

> Hi,
>
> I've got a couple of questions concerning CFoms.
>
> I've got a form which holds two date and an integer field.
> Either the two date fields or the integer field has to be filled out.
> If the date fields are filled out, the first date has to be 'smaller 
> or equal' than the second date.
>
> Question 1.:
> How do achieve the: "Either the two date fields or the integer field 
> has to be filled out".
>
> Question 2.:
> How do achieve the: "The first date has to be 'smaller or equal' than 
> the second date".
>
> Question 3.:
> After success I want to call either function aaa (if dates were filled 
> in) or function bbb (if integer was filled in). How can I manage this?
>
> My Forms-Definition so far:
>
> <fd:widgets>
>         <fd:field id="date1">
>                <fd:datatype base="date">
>                      <fd:convertor type="formatting">
>                         <fd:patterns>
>                               <fd:pattern>dd/MM/yyyy</fd:pattern>
>                         </fd:patterns>
>                   </fd:convertor>
>              </fd:datatype>
>         </fd:field>
>         <fd:field id="date2">
>                <fd:datatype base="date">
>                      <fd:convertor type="formatting">
>                         <fd:patterns>
>                               <fd:pattern>dd/MM/yyyy</fd:pattern>
>                         </fd:patterns>
>                   </fd:convertor>
>              </fd:datatype>
>         </fd:field>
>         <fd:field id="integer">
>                <fd:datatype base="integer">
>                   <fd:validation>
>                      <fd:range min="0"/>
>                  </fd:validation>
>              </fd:datatype>
>         </fd:field>     </fd:widgets>
>
> Thanks
> Jonny
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message