I need to crate validation for a single line of text column. The validation required is to count the total number of characters( Text and Numbers) entered amd validate that 7 items were entered.
When someone enters in their ID take "JN76161" for example I want the column to validate that they entered a total of 7 characters. No more no less.
If we can also validate so that it requires that the first two characters are text that would be awesome too.
Solved! Go to Solution.
for the length check you can use a simple validation rule:
This rule checks how many characters have been entered in the textbox and will only allow to submit the form if 7 characters have been entered.
And last but not least something usefull to create/test regular expressions: Online regex tester and debugger
using regular expression validation you may ensure both your requirements for length and starting with two (uppercase?) chars by following expression
Use regular expression in control settings:
Thank you Manfred, your regular expression worked.
Now, associates are allowed to type their ID either uppercase or lowercase. That being said I had to add.....
((^|, )(part1|part2))+$ I added your expression in part1 and part2 only changing the [a-z] to [A-Z].
It now accepts.... JN76161 or jn76161, but not JN7616 or jn7616.
Thank you for your quick response. Unfortunately I couldn't get your way to work.
I was able to use regular expressions explained by Manfred Lauer below.
You wanted to match 5 digits. So what You mean by 'but not JN7616 or jn7616'?
To match first 2 characters either lower or upper case use:
To match first 2 characters mixed case use:
Oh sorry, no it works exactly how you sent it to me. I was just going into greater detail for those reading the forum. I simply was clarifying that it works because it fails when I type more than 5 or less than 5.
I understand that your suggested reg. requires the exact format...
However, how can I make it so it request the "minimum" and maximum in following format:
What can go through examples: