Custom Patterns for every character except %, <, > - InfoPath Dev
in

InfoPath Dev

Custom Patterns for every character except %, <, >

Last post 09-05-2008 11:36 AM by mjaneczk. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-04-2008 11:28 AM

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Custom Patterns for every character except %, <, >

    I need to write a data validation for a field which can't have a %, <, or > character.  I essentially want to prohibit anyone from entering HTML code in a field, hence the <,> and % characters.

    How would I write that pattern?  I have something like this so far:

    [A-Za-z0-9 \-\.,\(\)]+

    But I get Invalid Pattern when I enter \&, \*

     

    Mike Janeczko
    Ford Motor Company
  • 09-04-2008 09:00 PM In reply to

    • ravig
    • Top 500 Contributor
    • Joined on 06-21-2008
    • Posts 27

    Re: Custom Patterns for every character except %, <, >

    Hi mjaneczk,

    Write data validation using ASCII values of the characters.

    Ravi G
  • 09-05-2008 12:06 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Custom Patterns for every character except %, <, >

    Hi,

     

    You can use following data validation:

    Field contains “<” or Field contains “>” or Field contains “%”

     

    Enter your validation message in Screen tip text box and click on ok.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 09-05-2008 11:32 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Custom Patterns for every character except %, <, >

    When I use \x20 (for instance), I get an invalid pattern.  Is there a special way in which to specify ASCII? 

    Mike Janeczko
    Ford Motor Company
  • 09-05-2008 11:36 AM In reply to

    • mjaneczk
    • Top 500 Contributor
      Male
    • Joined on 02-18-2008
    • Dearborn, MI
    • Posts 35

    Re: Custom Patterns for every character except %, <, >

    I should have read your post first!  :-) 

    That works.  Sometimes I miss the obvious.  Thanks!

    Mike Janeczko
    Ford Motor Company
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.