Form validation that requires 4 characters

  • 22 January 2019
  • 7 replies
  • 9 views

Badge +7

Hello

I have a single line text field which has a maximum of 4 characters called 'Ops ID'.  What would a regular expression in a Nintex form validation be that requires all 4 characters to be provided?

ab1f - valid (4 characters)

ab1 - invalid (only 3 characters)


7 replies

Userlevel 5
Badge +14

eg.

^[a-zA-Z0-9]{4}$‍

(allows both lower- and upper-case characters and any of their mix. if you only want lower-case ones remove 'A-Z' from the pattern)

Badge +7

Works perfect.  Thank you.

Badge +3

I need for the submittere to enter the year in to a text box. 

 

I tried use the script but I only need 4 number, so I removed "a-zA-Z".  

6931iD42D4D5BDD1F13C5.png

6932i39CD1BF075725511.png

 

I still get an error message.  Need help not sure what I am doing wrong.

 

Thanks

Userlevel 6
Badge +22
Hi,

Is there white space before the expression? The expression should work otherwise.
If a regualar expression does not work just use a range validation instead which is the option above the regular expression.
Badge +3

Thank you Simon it works!! 

 I went back and had to delete the single text box field and crate a new one.  Instead of coping and pasting the expression I typed it in. 

 

Badge

Thank you Simon it works perfect! Thank you.

happy wheels

Badge

Thanks in advance!

happy wheels

 
 

Reply