Validation help - InfoPath Dev
in

InfoPath Dev

Validation help

Last post 01-30-2009 03:45 PM by smods. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 01-13-2009 04:48 AM

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

    Validation help

    Hi all,

    I have been messing with the data validation on my form and I am not having much luck!

    I want my e-mail address field to only accept certain domains.

    So I want to say if last half of the e-mail address does not end "@hotmail.com", "@hotmail.co.uk" or "@live.co.uk" then it's not a valid e-mail address. 

    I did this in the validation and it wouldn't accept it because of the prefix.  Although the field contained "@hotmail.co.uk" it didn't like the text prioir to it

    (i.e. [email protected])

    How do I overcome this?

    Thanks

    Chris

  • 01-13-2009 07:05 AM In reply to

    In the past I have used the following pattern for emails. It allows dots in the prefix. Perhaps, when combined with your pattern for hotmail/live in the suffix, you can come up with the desired result.

    (\p{L}+_*-*\p{L}*\d*\.?)+@(\p{L}+-*\p{L}*\.?)+

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-23-2009 02:07 AM In reply to

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

    I've been messign around with this but cannot get this to work.  Any ideas?

    Thanks

  • 01-23-2009 03:50 AM In reply to

    Hi,

    Try the following expression in the data validation of the email text box.

    not(xdUtil:Match(string(.), "[email protected]"))  and not(xdUtil:Match(string(.), "[email protected]")) and not(xdUtil:Match(string(.), "[email protected]"))

    Swathip
    www.ggktech.com
  • 01-23-2009 03:52 AM In reply to

    This expression should do the trick:

    (\p{L}+([_\-\.]|\d)*)+@((hotmail|live)\.co\.uk|hotmail\.com)

     

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-23-2009 02:30 PM In reply to

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

     Thanks Jimmy, works a treat.  How would the code change to make a decimal point mandatory?

     So I want

    name.surname@live/hotmail.co.uk/hotmail.com

  • 01-23-2009 05:11 PM In reply to

    How's this:

    (\p{L}(\-\p{L})?)+\.(\p{L}(\-\p{L})?)+@((hotmail|live)\.co\.uk|hotmail\.com)

    This one requires a first and last name separated by a period, where the first and last name can optionally contain hyphens, but not two hyphens in a row, and no hyphen at the beginning or end of a name.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 01-26-2009 01:27 AM In reply to

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

    Jimmy you are a genius!  Thanks :D Can you also tweak the code so that numbers and apostrophes are allowed?

    Can you also tell me what I need to set in other fields so that each new word starts with a capital letter?  Similar to the proper function in Excel.

     Cheers

    Chris

    Filed under:
  • 01-30-2009 03:45 PM In reply to

    • smods
    • Not Ranked
    • Joined on 08-06-2008
    • Posts 25

     Sorry to bother you Jimmy but can you help?

Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.