How do I limit the amount of characters in a number entry element?

  • jelacayo
    Asked on August 8, 2018 at 2:04 PM
  • David JotForm Support
    Replied on August 8, 2018 at 2:29 PM

    In the options menu for number fields, there is an option to set a minimum and maximum value for the input:

    1533752958Capture Screenshot 10

    If you want 4 digits for example, you would enter 9999 as the maximum value.

  • jelacayo
    Replied on August 8, 2018 at 4:09 PM

    Hi, that's where I thought you could do it, but after trying several times I think that allows you to put a value in beetween the minimum and maximum that is set.  For Example If I put minimum of 1 and a maximum of 100, then I can type any number between those two.  What I want to do is to make sure a person types all the required numbers in the field.  For Example an ID number that has 9 digits, so if only 8 digits are typed it shows an error since the ID must have 9 digits.


    Thanks!

  • jonathan
    Replied on August 8, 2018 at 4:30 PM

    I think what you need is the Input Mask option property of the field.

    You can also just use the Short Entry field element (not the Number field), and just set its validation to Numeric data type.

    1533760201zzz 2018 08 09 04 Screenshot 10


    Please check the user guide: Getting Started with the Basics of Input Masking

    Please take note that it will work only on Short Entry (Textbox field)


  • jelacayo
    Replied on August 8, 2018 at 5:35 PM

    Thanks!  That's exactly what I needed!