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

  • Profile Image
    Asked on January 26, 2018 at 05: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 

  • Profile Image
    Answered on January 26, 2018 at 06: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.

  • Profile Image
    Answered on January 29, 2018 at 05:00 AM


    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?

  • Profile Image
    Answered on January 29, 2018 at 09: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:


    Please take a look at the following demo form and see if it works as expected: 

    Feel free to clone this form for a closer look. The following guide should help you in form cloning:

  • Profile Image
    Answered on January 29, 2018 at 01: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.

  • Profile Image
    Answered on January 29, 2018 at 01: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.