How can I limit the number of characters to 4 with input masking?

  • kzc_badania
    Asked on January 26, 2018 at 5:02 PM

    I use Masked Imput Widget to specify weight and height mesurements in format with precision to one decimal place.

    I want to specify that a person who fulfills the form can put maximally four characters e.g. 0,5 1,5 11,5 111,5 (max). Is there a custom CSS needed?

    Thanks in advance 

    Jotform Thread 1363754 Screenshot
  • Support_Management Jotform Support
    Replied on January 26, 2018 at 6:32 PM

    Instead of using the MASKED INPUT WIDGET, I recommend you use the regular SHORT TEXT ENTRY field. This should allow you to achieve both input masking and limit entry.

    To setup an input mask with a short text entry field, refer to the guide below.

    Complete guide: Getting-Started-with-the-Basics-of-Input-Masking

    And to enable the limit entry option, click the textbox field on your form > the GEAR icon > go to the OPTIONS tab > turn ON the LIMIT ENTRY option and set it to 4. You can turn on INPUT MASKING on that section too.

    How can I limit the number of characters to 4 with input masking? Image 1 Screenshot 20

  • kzc_badania
    Replied on January 29, 2018 at 5:00 AM

    @Jim_R

    If I use Mask Input I cannot entry values "shorter" then maximal input eg. ___,_ (3 places and 1 one decimal place)

    I can write 100,0 but if I want to put there 10,0 -> _10,0 it will move to left 100,_ 

    It CANNOT be splited into two fields as well as 0 CANNOT be included in front to block first field.

    How can I solve it?

  • Ashwin JotForm Support
    Replied on January 29, 2018 at 9:51 AM

    In that case I will suggest you to use "Masked Input" widget but do not set the "Custom Pattern" setting. You can just set "Number precision" as "1" and "Decimal separator" as ",". That should solve your problem. Please check the screenshot below:

    1517237388maskedInput Screenshot 10

    Please take a look at the following demo form and see if it works as expected:   https://form.jotform.com/80020881242951 

    Feel free to clone this form for a closer look. The following guide should help you in form cloning:   https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL


  • kzc_badania
    Replied on January 29, 2018 at 1:03 PM

    That was the first thing which I implemented however it doesn't change the fact that I can still put there infinite values.

  • Ashwin JotForm Support
    Replied on January 29, 2018 at 1:14 PM

    Yes that is correct. I will do some more test but I am not sure if it possible to restrict the input along with the decimal value. 

    We will get back to you if I am able to find any solution to achieve your requirement.