You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Daniel Curran <da...@dotech.com> on 2005/09/07 21:07:47 UTC

Interesting CForms Validation Behavior

When I apply this formatting to my double in my form definition file I 
am seeing a weird issue with truncating my data, instead of throwing a 
validation error.

The convertor I have applied:

<fd:datatype base="double">
   <fd:convertor type="formatting">
       <fd:patterns>
           <fd:pattern>#,##0.00</fd:pattern>
       </fd:patterns>
   </fd:convertor>
</fd:datatype>

When I enter a number such as 123abc the number that is stored is 123.

What I would expect to happen is that a validation error would be thrown 
showing the number I entered to be invalid.

Is there a fix to this behavior? or do you know what might be causing this?

Thanks,
Dan


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


Re: Interesting CForms Validation Behavior

Posted by Jeroen Reijn <j....@hippo.nl>.
Dan,

if you want to have validation I guess you should have the validation element 
within your widget definition.

<fd:validation>
</fd:validation>

See http://cocoon.apache.org/2.1/userdocs/forms/validation.html#General+remarks 
for some more information.

Greetz,

Jeroen

Daniel Curran wrote:
> When I apply this formatting to my double in my form definition file I 
> am seeing a weird issue with truncating my data, instead of throwing a 
> validation error.
> 
> The convertor I have applied:
> 
> <fd:datatype base="double">
>   <fd:convertor type="formatting">
>       <fd:patterns>
>           <fd:pattern>#,##0.00</fd:pattern>
>       </fd:patterns>
>   </fd:convertor>
> </fd:datatype>
> 
> When I enter a number such as 123abc the number that is stored is 123.
> 
> What I would expect to happen is that a validation error would be thrown 
> showing the number I entered to be invalid.
> 
> Is there a fix to this behavior? or do you know what might be causing this?
> 
> Thanks,
> Dan
> 
> 
> ---------------------------------------------------------------------
> 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