Disallowing user to enter special charecters - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Disallowing user to enter special charecters

Last post 12-16-2015 12:37 PM by javicartin. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 06-11-2008 03:26 AM

    Disallowing user to enter special charecters

    Hi,

    On my InfoPath form I have a Phone Number field. The business requirement is that the user should only be allowed to enter numbers, -, (, ) (i.e. user should only allowed to enter numbers, hyphen, opening bracket & closing bracket).

    In general how do I prompt user when user enters special charecters which we do not want them to enter.

     

     Regards,

    Vipul Mehta

    Vipul Mehta
  • 06-20-2008 09:10 AM In reply to

    Re: Disallowing user to enter special charecters

    Hi, Vipul:

     You can use data validation. Select Data Validation for the field you wish to limit input on, select Add in the Data Validtion window for Conditions. In the first dropdown you will have the field you have currently selected, in the second, select "does not match pattern" and in the third dropdown select "Select a pattern". The Data Entry Pattern window opens, and it already has a phone number pattern defined that you can use. Add screen tip and message for your user when data is entered incorrectly and then preview your form and test by entering incorrect data.

     

    Hilary Stoupa

  • 07-14-2008 12:51 PM In reply to

    • doug.hay
    • Not Ranked
    • Joined on 12-21-2004
    • Canada
    • Posts 2

    Re: Disallowing user to enter special charecters

    Any suggestions on creating a pattern that will allow any combination of letters or numbers but disallow any special characters.

    Doug Hay
  • 07-18-2008 07:19 AM In reply to

    Re: Disallowing user to enter special charecters

    Hello:

    The following pattern allows only letters and digits, in any order (you can begin with letters or with digits). It allows no other characters, however, including the space character:

    \p{L}*\d*|\d*\p{L}*

    I used the Insert special character dropdown in the Data Entry Pattern window to select the following:

    1. Any letter: \p{L}
    2. Zero or more: *
    3. Any digit: \d
    4. Zero or more: *

    I then added a pipe ( | ) for "or" and reversed the pattern so that the field could begin with a letter or a number.

    Hope that helps!

    Hilary Stoupa

  • 12-08-2008 01:44 AM In reply to

    Re: Disallowing user to enter special charecters

    Hi Hillary,

    The above pattern fails for these values : s1s,1a1,sa1s

    Any suggestions on this would be appreciated !

     

    Thanks & Regards,
    Srikrushna Patro.
  • 12-08-2008 02:03 AM In reply to

    Re: Disallowing user to enter special charecters

    Hi,

    To accept the above patterns use the following expressions with or (|) including the above the expressions.

    \p{L}*\d*\p{L}*

    \d*\p{L}*\d*

     

    The total expression is like

    \p{L}*\d*|\d*\p{L}*|\p{L}*\d*\p{L}*|\d*\p{L}*\d*

     

    Swathip
    www.ggktech.com
  • 12-08-2008 02:34 AM In reply to

    Re: Disallowing user to enter special charecters

    Hi Swathip,

     

    Fails for these values : a1a1,sa1sa1.

    Basically I am looking for an expression which should not fail for any combination of characters and letters.

    Thanks & Regards,
    Srikrushna Patro.
  • 12-09-2008 12:20 AM In reply to

    Re: Disallowing user to enter special charecters

    Bingo,

    I tried with this expression :

    \p{L}*\d*|\d*\p{L}*|[\p{L}\d]*

    Working fine !

    Thanks & Regards,
    Srikrushna Patro.
  • 12-16-2015 12:37 PM In reply to

    Re: Disallowing user to enter special charecters

     Hello Hilary, thank you for your great answers,

    I would like to meet this expression.

    On the field, I have this expression: nnn/nn-nn-nnn-nnWn

    Now, on the rule, I have the following, but now I require that the user can put a number or a letter, please see attachment, what could be the expression to use any number/letter, like changing \d into .

    Thanks again

     

     


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