cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
human_hide
Nintex Newbie

Format of Single Line of Text field

Hello,

Need some help with the format of a single line of text field using Nintex form. I need the control to be invalid if the set format is not followed. It should be in the following format (########-##-##-####). 

I was able to accomplish this in the column validation settings using the following formula: where "text" is the single line of text column:

=AND(LEN(text)=22,(MID(text,9,1)="-"),(MID(text,12,1)="-"),(MID(text,15,1)="-"),(MID(text,18,1)="-"))

However this is not allowing me to set the error message as I want when filling the form. It is throwing a generic error of something went wrong, please try again.

Any help or information is much appreciated. 

Regards,

Ronnie.

Labels: (1)
0 Kudos
Reply
2 Replies
emha
Nintex Newbie

Re: Format of Single Line of Text field

you could use regular expression validation with following pattern

^\d{8}-\d{2}-\d{2}-\d{2}-\d{4}$‍

Reply
sean_fiene
Nintex Newbie

Re: Format of Single Line of Text field

Hi Ronnie,

Great question. 

Regex validation is going to be the right choice, just like Marian Hatala‌ mentioned. 

I used the following: (\w{8}|\d{8})[-](\w{2}|\d{2})[-](\w{2}|\d{2})[-](\w{4}|\d{4})

However, I also used an external JS library called Cleave.js to format the input box for me: Cleave.js - Format input text content when you are typing 

Using the following JS, I was able to enforce the formatting of the Single line text box: 

NWF$(document).ready(function () {
var cleave = new Cleave('.input-element', {
delimiter: '-',
blocks: [8, 2, 2, 4],
numeric: true
});
});
Reply