I want to set the mask to it can be either one mask or another

  • Profile Image
    tutuprat
    Asked on October 04, 2018 at 02:25 PM

    hey, I want to set the mask to it can be either number like 09.15 ##.## or 2.01 #.##

    not sure how to set the mask so it works for both



    This is a re-post of a comment on Getting Started with the Basics of Input Masking

  • Profile Image
    Richie_P
    Answered on October 04, 2018 at 03:35 PM

    I'm not sure I understood your question clearly. Do you want to set your text to mask the number 09 with a dot?

    You just add the number before you separate with the symbols.

    Sample screenshot.

    Sample screen cast:

    Please give it a try and let us know how it goes.

    Thank you.

  • Profile Image
     
    Answered on October 04, 2018 at 05:23 PM

    Hey,


    Thanks for your answer, the question was quite simple through. 

    Some numbers are ##.##(two digits, dot, two digits), others are #.##(one digit, dot, two digits).

    I understand the logic of the mask, it’s just that ##.## would not allow people to enter numbers such as “2.03” (only one digit before the dot)


    cheers,

  • Profile Image
    Mike
    Answered on October 04, 2018 at 08:13 PM

    I am afraid that the input mask option is not that flexible.

    We cannot specify two different input mask in the same field unless we use some conditional logic.

    For example, if the numbers starting from 2 are supposed to use a different mask, we can implement it with conditions:

    Example:

    https://form.jotform.com/82767312241959

  • Profile Image
    tutuprat
    Answered on October 04, 2018 at 08:18 PM

    Hi, 


    Many thanks for your answer, this totally makes sense. I didn't know you could add conditions to the masks.


    Cheers,

  • Profile Image
    tutuprat
    Answered on October 05, 2018 at 02:52 AM

    Now I'm having second thoughts about this as it would not actually work.

    What if I have a number 12.08 and other 1.06, they would be under the same condition :(


  • Profile Image
    Victoria_K
    Answered on October 05, 2018 at 07:05 AM

    Unfortunately, this does not seem to be implementable if you do not have exact condition when to set the #.## mask. You could advise your users to start with 0 in this case and to keep the ##.## mask or to change it to #.## conditionally if input starts from zero.

    Hope this helps.