Dashboard > WebWork > ... > Validation > email validator
  WebWork Log In View a printable version of the current page.  
  email validator
Added by tm_jee, last edited by tm_jee on Dec 11, 2005  (view change)
Labels: 
(None)

Description

EmailValidator checks that a given String field, if not empty, is a valid email address.

The regular expression used to validate that the string is an email address is:

\\b(^[_A-Za-z0-9-](\\.[_A-Za-z0-9-])*@([A-Za-z0-9-])+((\\.com)|(\\.net)|(\\.org)|(\\.info)|(\\.edu)|(\\.mil)|(\\.gov)|(\\.biz)|(\\.ws)|(\\.us)|(\\.tv)|(\\.cc)|(\\.aero)|(\\.arpa)|(\\.coop)|(\\.int)|(\\.jobs)|(\\.museum)|(\\.name)|(\\.pro)|(\\.travel)|(\\.nato)|(\\..{2,3})|(\\..{2,3}\\..{2,3}))$)\\b

Parameters

  • fieldName - The field name this validator is validating. Required if using Plain-Validator Syntax otherwise not required

Examples

<!-- Plain Validator Syntax -->
<validators>
    <validator type="email">
        <param name="fieldName">myEmail</param>
        <message>Must provide a valid email</message>
    </validator>
</validators>

<!-- Field Validator Syntax -->
<field name="myEmail">
   <field-validator type="email">
      <message>Must provide a valid email</message>
   </field-validator>
</field>

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators