You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ramadoss Chinnakuzhandai <rc...@register.com> on 2004/04/13 18:54:47 UTC
Email Validation
Hi,
I'm using custom email validation using mask defined in my validation.xml...when I enter an invalid email as xyz@.xyz.com it fails to validate the . (dot symbol infront of xyz.com) as a invalid one though I metioned expression value must be of [A-Z0-9a-z] after @
Following is my regular expression
<constant>
<constant-name>emailAddress</constant-name>
<constant-value>^[A-Z0-9a-z_]+(.)?[A-Z0-9a-z_]+@[A-Z0-9a-z]+(.)?[A-Z0-9a-z%-]+\.[A-Za-z]+(.)?[A-Za-z]{2,4}$</constant-value>
</constant>
Following is the field ccEmail
<field property="ccEmail" depends="required,mask">
<arg0 key="form.email"/>
<msg name="mask" key="errors.email"/>
<var>
<var-name>mask</var-name>
<var-value>${emailAddress}</var-value>
</var>
</field>
Can anybody correct me where I'm doing wrong or suggest me any better approach.
Thank you,
-Ramadoss
Note: I tried build-in email validation but still I'm able to enter invalid email address and proceed.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org