Validate contents of text field to find a single occurance of an Upper or Lower case character. - InfoPath Dev
in

InfoPath Dev

Validate contents of text field to find a single occurance of an Upper or Lower case character.

Last post 04-02-2014 08:57 AM by JeffVojtko. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-21-2014 09:07 AM

    • VenUK
    • Not Ranked
    • Joined on 02-21-2014
    • Posts 2

    Validate contents of text field to find a single occurance of an Upper or Lower case character.

    Hi All

    Sorry if I'm covering old ground for you guys but I've been banging my head on wall with this and I'm beginning to think it's not possible.

    The situation is: I have an Infopath form attached to a list with custom columns in SharePoint 2010 that contains various fields to populate new items in to the list and that is all fine and dandy. The problem is one of the field is a password field and must be validated to conform to the strong password style of must contain at least  1 Uppercase, 1 Lowercase, 1 Digit, 1 Symbol and at least 8 character long. I've been all over the web to back of beyond trying with regular expressions and formulas and even seen some options using the translate function but nothing seems to do the trick. Regular expressions in rules using the "Does not match pattern" just doesn't seem to work in quite the right way i.e. a regex of [a-zA-Z0-9\p{S}]+ doesn't seem to enforce the you must have 1 Upper, 1 Lower etc.... Any other examples I've tried to use just give me the "Invalid Pattern".

    First am I going about this in the right way or is there a better way of doing it?

  • 02-25-2014 08:01 AM In reply to

    • VenUK
    • Not Ranked
    • Joined on 02-21-2014
    • Posts 2

    Re: Validate contents of text field to find a single occurance of an Upper or Lower case character.

    UPDATE:

    I've managed to resolve this. But to do it was very convoluted. I had to add 4 new Textboxes (Because for some reason you can't hide checkboxes with a format rule) with default values of FALSE. Each Textbox represented the different things I was looking for i.e. Uppercase letter, Lowercase letter, Digit and Special character. I then had to create multiple rules on the text input that would check for the existence of a letter so the rules where grouped A-E (As you can only have 5 conditions per rule) F-J, K-0 etc and each one would if the letter was missing set the value of the Textbox called "UppercaseIsPresent" to "TRUE".

    Let me flesh that out a bit the first rule checked for 5 separate letters. 

    Password does not contain "A" or 

    Password does not contain "B" or 

    Password does not contain "C" or 

    Password does not contain "D" or 

    Password does not contain "E"

     

    Action:

    UppercaseIsPresent value = TRUE

     

    So I had to do that for all uppercase letters and all lowercase letter and all numbers and all the symbols. Not a pretty solution but it does work ok. The only additional issue I came up with was hiding the controls on the page because when the textbox control was updated with a new value it became visible again on the page. So I added format rules to say if the Textbox was equal to True or the Textbox was equal to false then the format was Hidden.

    This was so frustrating and unnecessarily difficult I would have though that there would have been some basic string search functionality 

  • 04-02-2014 08:57 AM In reply to

    Re: Validate contents of text field to find a single occurance of an Upper or Lower case character.

     I had a sort of the same problem. Check out this post - http://www.infopathdev.com/forums/p/27927/96569.aspx#96569

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