You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by oron ogdan <or...@netada.co.uk> on 2003/09/01 02:03:12 UTC
Intake - non required field with mask ?
Hi Turbine Users / Developers
What's the best way to deal with a non required field that needs a mask,
Example - additional user email , I would like it to be optional in the user
details data
but if something is put there, I want to verify vis-a-vis email regexp
I tried required = false
and minLength = 0
but that's not it, Any suggestions ?
Oron
http://netada.co.uk
RE: Intake - non required field with mask ?
Posted by oron ogdan <or...@netada.co.uk>.
Yes my bad
by RegExp was forcing some input
Thx for the sample
Oron
-----Original Message-----
From: Scott Eade [mailto:seade@backstagetech.com.au]
Sent: Monday, September 01, 2003 2:06 AM
To: Turbine Users List
Subject: Re: Intake - non required field with mask ?
oron ogdan wrote:
>What's the best way to deal with a non required field that needs a mask,
>Example - additional user email , I would like it to be optional in the
user
>details data
>but if something is put there, I want to verify vis-a-vis email regexp
>
>I tried required = false
>and minLength = 0
>
>but that's not it, Any suggestions ?
>
Doesn't this work:
<field name="Email" key="email" type="String">
<rule name="required" value="false">Please enter an email
address.</rule>
<rule name="mask"
value="^([\w\-]+\.)*[\w\-]+@([\w\-]+\.)+([\w\-]{2,3})$">Please enter a
valid email address.</rule>
<rule name="maxLength" value="64">Please enter a maximum of 64
characters.</rule>
</field>
It does for me.
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
Re: Intake - non required field with mask ?
Posted by Scott Eade <se...@backstagetech.com.au>.
oron ogdan wrote:
>What's the best way to deal with a non required field that needs a mask,
>Example - additional user email , I would like it to be optional in the user
>details data
>but if something is put there, I want to verify vis-a-vis email regexp
>
>I tried required = false
>and minLength = 0
>
>but that's not it, Any suggestions ?
>
Doesn't this work:
<field name="Email" key="email" type="String">
<rule name="required" value="false">Please enter an email
address.</rule>
<rule name="mask"
value="^([\w\-]+\.)*[\w\-]+@([\w\-]+\.)+([\w\-]{2,3})$">Please enter a
valid email address.</rule>
<rule name="maxLength" value="64">Please enter a maximum of 64
characters.</rule>
</field>
It does for me.
Scott
--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au