Regex for a multitext field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Regex for a multitext field

Last post 12-22-2021 11:03 AM by sb_infodev. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-29-2021 03:05 AM

    Regex for a multitext field

    Hi All, I have InfoPath 2013 form, the form has a multitext field. The field should contain information like - 1234567; 1234567; 1234567; 1234567; I need to make sure that user enters all numbers with 7 digits separated by '; ' semi comma and space. Can you please let me know how to achieve this.
  • 12-01-2021 08:51 AM In reply to

    Re: Regex for a multitext field

    Is this a list form? Do you mean the field is multi-line? If so - is it plain text in the list settings?
    Hilary Stoupa

  • 12-21-2021 12:54 AM In reply to

    Re: Regex for a multitext field

    Yes its a list form and a plain multiline field. I used this - ([0-9]{7}(;\s[0-9]{7})*;). it works but as soon as I enter a pattern that doesnt match this regex it shows an error ( which is fine) but even after correcting the text in the field this error doesnt go away. Once an error appears it stays irrespective of the entry in text field.
  • 12-22-2021 07:51 AM In reply to

    Re: Regex for a multitext field

    Hmmm. I don't know how helpful this is, but I just tested this in a list form of mine. I checked in preview and in the published form, and in all cases the validation worked as expected. The field was marked invalid unless I had 7 digits, followed by a semicolon and a space for any additional numbers.
    Hilary Stoupa

  • 12-22-2021 09:51 AM In reply to

    Re: Regex for a multitext field

    Thanks for your response. I forgot to mention this is an auto populated field, which user can edit later. I tried it on regular field and it works too. 2 things that pop to my mind : --Can it be some sort of caching issue? Once the error appears it doesn't go, but as long as user is entering correct data it works. --Can this issue be because its auto populated? Please let me know if you feel I am missing out something.
  • 12-22-2021 10:54 AM In reply to

    Re: Regex for a multitext field

    So - by auto populated, you mean it has a default value? Or is it being set by a rule?
    Hilary Stoupa

  • 12-22-2021 11:03 AM In reply to

    Re: Regex for a multitext field

    It has default value based on another field. Something like this in the default value - eval(eval(Title[Test= Value], 'concat(., "; ")'), "..") The 'Title' and 'test' coming from another list using data connection and 'Value' coming from another column in the form.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.