cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How can I restrict a text field to only allow so many numbers?

Jump to solution

I have some text fields that i need to be restricted to 4 or 10 numbers.   How can I accomplish this?

Labels: (2)
Reply
8 Replies
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

On the text field configuration, under advanced section, you can set the Max Length field.    This will restrict the number of characters one can type, assuming you mean characters and not "numbers" specifically.

Thanks

0 Kudos
Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

This is all I see when I am in the text field settings.

0 Kudos
Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

Ok, that is because you have the text field "connected" to a column in the list.   In this case you need to go to List Settings, and click on the column name you want to set a max character limit for, and enter this number in the Max number of characters field in the list itself.  The Nintex form will respect the number you set here.

Thanks

0 Kudos
Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

You can use a validation with Regular expression:

^\d{10,10}|\d{4,4}$

Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution


You can use a validation with Regular expression:

Example if you only need 7 numbers to be entered in the field, double click on the field for settings.  Then Select Yes for "Use Regular Expression" and enter the expression  .{7}

Thx!

0 Kudos
Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

Dot matches any character. To match a digit you have to use \d. See my previous answer and Regular Expression Language - Quick Reference .

0 Kudos
Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

In the event that you want numbers only, instead of a period ".", please use the following for 7 digits only... ^\d{7}$

Reply
Workflow Hero

Re: How can I restrict a text field to only allow so many numbers?

Jump to solution

I have a requirement for exactly 9 characters with a single dot (.) and no spaces on start, end, or in between characters. For example: 1234a6.01

1234a6 = can be numbers or string only

. = must be a dot (.) exactly after 6 characters

01 = must be number only

I was able to with: ^[a-zA-Z0-9\.\S]{9,9}$

but i can still input alphabet after the dot (.), and insert dot anywhere.

0 Kudos
Reply