Custom Pattern Validation Rule - Unable to use Apostrophes? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Custom Pattern Validation Rule - Unable to use Apostrophes?

Last post 12-15-2020 07:53 AM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 12-10-2020 03:27 AM

    • Nerge
    • Not Ranked
    • Joined on 08-23-2016
    • Posts 4

    Custom Pattern Validation Rule - Unable to use Apostrophes?

    Hi Everyone, I'm having a problem with a validation rule that we're using on text fields that we're using for email entry on some forms. We're using the following custom pattern to try and ensure people are entering emails in a standard format, if they don't they get the usual red outline/advisory text on the field: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,4} The issue we have is this rule can't handle form users who have an apostrophe in their name, they'll get the invalid email text etc. I have tried to add an apostrophe in here but it always shows as an 'Invalid pattern' on the 'Data Entry Pattern' window; there's also no option for apostrophes in the 'Insert a special character' drop-down on the same window. I assume this is because an apostrophe may be some sort of reserved character in InfoPath, is there any way around this without resorting to code etc? Thank you.
  • 12-10-2020 11:35 AM In reply to

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    Oh, interesting! I wonder about using two validation rules - your stricter rule if the subsubstring-before the "@" does not contain an apostrophe, and a different pattern that allows any character if it does. Clunky, but I'm not thinking of another workaround offhand.... I've attached a sample, just right click the linked file and save it locally, then right click the saved file and select Design to open in design mode....
    Hilary Stoupa

  • 12-11-2020 01:01 AM In reply to

    • Nerge
    • Not Ranked
    • Joined on 08-23-2016
    • Posts 4

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    Hi Hilary.

    Thanks for that.

    I'm new to posting here so may be missing something, but I can't see the linked file you mentioned.

    Thank you. 

     

  • 12-11-2020 07:48 AM In reply to

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    That's because I forgot to attach it! ;)
    Hilary Stoupa

  • 12-14-2020 12:58 AM In reply to

    • Nerge
    • Not Ranked
    • Joined on 08-23-2016
    • Posts 4

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

     Thank you, although I can't open that in design view as it says it was created with a newer version of InfoPath - I'm on 2010 right now - is it a 2013 version?

  • 12-14-2020 07:33 AM In reply to

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    Here is a copy saved as 2010 compatible.
    Hilary Stoupa

  • 12-15-2020 01:42 AM In reply to

    • Nerge
    • Not Ranked
    • Joined on 08-23-2016
    • Posts 4

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    That seems to work perfectly and just what I needed - thank you. :)
  • 12-15-2020 07:53 AM In reply to

    Re: Custom Pattern Validation Rule - Unable to use Apostrophes?

    Wonderful! Glad we could come up with a work-around!
    Hilary Stoupa

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