You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Fuat Akal <ak...@fgcz.ethz.ch> on 2008/10/15 17:47:05 UTC

validation of fields defined as double or integer?

Hello all,

I receive a strange(?) behaviour when I enter non-digit characters into 
numeric fields. Assume that you define a field of double type as:

<fd:field id="myField">
            <fd:datatype base="double"/>
</fd:field>

When I enter a value like "123abc", the value of myField becomes 123. I 
would expect a validation error here though.

I could write my own validation script to check if the value is properly 
entered. Then, what is the point in defining the field as double. 
Anyhow. Is this a bug? If not, what is the easiest way to check if a 
proper value is entered into myField?

Kind Regards
Fuat

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


Re: validation of fields defined as double or integer?

Posted by asif_zzz <aa...@hotmail.com>.
Hi,

Im also having the same problem.
I think this is a bug.
Im using Cocooc 2.1.10
-- 
View this message in context: http://www.nabble.com/validation-of-fields-defined-as-double-or-integer--tp19996357p20044466.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: validation of fields defined as double or integer?

Posted by Fuat Akal <ak...@fgcz.ethz.ch>.
Here is the answer to my question in case somebody needs.

<fd:field id="myField">
    <fd:datatype base="double" >
        <fd:convertor type="plain"/>
    </fd:datatype>
</fd:field>

-fa


Fuat Akal wrote:
> Hello all,
>
> I receive a strange(?) behaviour when I enter non-digit characters 
> into numeric fields. Assume that you define a field of double type as:
>
> <fd:field id="myField">
>            <fd:datatype base="double"/>
> </fd:field>
>
> When I enter a value like "123abc", the value of myField becomes 123. 
> I would expect a validation error here though.
>
> I could write my own validation script to check if the value is 
> properly entered. Then, what is the point in defining the field as 
> double. Anyhow. Is this a bug? If not, what is the easiest way to 
> check if a proper value is entered into myField?
>
> Kind Regards
> Fuat
>
> ---------------------------------------------------------------------
> 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