Setting both the minimum and maximum digits for a field

  • 14 March 2016
  • 1 reply
  • 19 views

Badge +1

I have a field on a view on the form which I need to make the user enter a 7-digit number.  This field will always be required, and it will always be exactly a 7 digit number.  I was able to set the Max Length of the field to 7 and set the pattern to ^[0-9]+$ and it works for the most part by not letting them enter anything except numbers and limiting the field to 7, but it still lets them enter less than 7 numbers.  Any ideas?

 

Thanks!

 


1 reply

Badge +1

I figured it out.   ^[0-9]{7}$    Thanks!

Reply