Skip to main content
Nintex Community Menu Bar

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

  • October 29, 2014
  • 8 replies
  • 262 views

Forum|alt.badge.img+2

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

8 replies

Forum|alt.badge.img+12
  • October 29, 2014

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


Forum|alt.badge.img+2
  • Author
  • October 29, 2014

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


Forum|alt.badge.img+12
  • October 30, 2014

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


Forum|alt.badge.img+9
  • October 30, 2014

You can use a validation with Regular expression:

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


Forum|alt.badge.img+2
  • Rookie
  • April 27, 2015


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!


Forum|alt.badge.img+9
  • April 28, 2015

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


Forum|alt.badge.img+2
  • Rookie
  • April 30, 2015

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


Forum|alt.badge.img+4

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.