You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Tarun <ta...@secf.com> on 2004/07/13 09:53:43 UTC

Is it possible to make your Own rules to validate the form field

Hi All
Is it possible to make your Own rules to validate the form field.

As in intake.xml file we define the rule name tag with name= minlength,maxlength and mask etc. Can we create another validation too Other than which the turbine provides. If Yes how can we?? 

<group name="Login" key="login">

<field name="Username" key="u" type="String">

    <rule name="minLength" value="1">Please enter an email address</rule>

    <rule name="mask" value=".+@.+\..+">Please enter a valid email address</rule>

</field> 

</group>



Thanks and Regards

Tarun

RE: Is it possible to make your Own rules to validate the form field

Posted by David Demner <tu...@demner.com>.
Tarun,

I looked into doing something like this a while ago.  The only way I found
was actually modifying the turbine source, an idea I quickly abandoned.

You can probably switch from intake to commons-validator
(http://jakarta.apache.org/commons/validator/), which is probably more
flexible.  I haven't used it, but apparently others have.  See old posts on
the list for more info.

Good luck,

David

-----Original Message-----
From: Tarun [mailto:tarun.narang@secf.com] 
Sent: July 13, 2004 12:54 AM
To: turbine
Subject: Is it possible to make your Own rules to validate the form field


Hi All
Is it possible to make your Own rules to validate the form field.

As in intake.xml file we define the rule name tag with name=
minlength,maxlength and mask etc. Can we create another validation too Other
than which the turbine provides. If Yes how can we?? 

<group name="Login" key="login">

<field name="Username" key="u" type="String">

    <rule name="minLength" value="1">Please enter an email address</rule>

    <rule name="mask" value=".+@.+\..+">Please enter a valid email
address</rule>

</field> 

</group>



Thanks and Regards

Tarun


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org