You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by argan <my...@sohu.com> on 2002/05/15 11:13:46 UTC
how to validate an "int" field with intake?
Hello,
how can i validate an "int" field with intake?
in my intake.xml,there is a field
<group ....>
<field name="LeadsCount" key="leadscount" type="int" mapToProperty="LeadsCount">
<rule name="mask" value="^$|[0-9]+">Please input a valid count</rule>
<rule name="minValue" value="0">Value must greater than 0</rule>
<rule name="maxValue" value="65535">Value can not greater than 65535</rule>
<required-message>This module requires a valid count.</required-message>
</field>
</group>
but it doesn't work,why?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: how to validate an "int" field with intake?
Posted by Scott Eade <se...@backstagetech.com.au>.
<required-message> is for when you will be dynamically setting whether or
not the field is required.
I think what you want is:
<rule name="required" value="true">Please enter a value.</rule>
I'm using the intake from tdk2.1 with a couple of very minor patches. When
I enter a large number into an int field I get some kind of error (doesn't
spring to mind) even when I have specified a maxValue rule. Something to
watch out for.
Scott
> From: "argan" <my...@sohu.com>
> Organization: ali
> Reply-To: "Turbine Users List" <tu...@jakarta.apache.org>
> Date: Wed, 15 May 2002 17:13:46 +0800
> To: "turbine-user@jakarta.apache.org" <tu...@jakarta.apache.org>
> Subject: how to validate an "int" field with intake?
>
> Hello,
> how can i validate an "int" field with intake?
> in my intake.xml,there is a field
> <group ....>
> <field name="LeadsCount" key="leadscount" type="int"
> mapToProperty="LeadsCount">
> <rule name="mask" value="^$|[0-9]+">Please input a valid count</rule>
> <rule name="minValue" value="0">Value must greater than 0</rule>
> <rule name="maxValue" value="65535">Value can not greater than 65535</rule>
> <required-message>This module requires a valid count.</required-message>
> </field>
> </group>
>
> but it doesn't work,why?
>
>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>