How to set the content mask input to just set the decimal places not the leading values?

  • Profile Image
    blakefam
    Asked on April 24, 2016 at 11:29 PM

    I have managed to set up a content mask for cost values in my form at https://www.jotform.com//?formID=60827059885873

    However if the value entered needs to be only a 'small amount, zeros need to be included to fill the input. eg. $004.57

    Is there a way I can retain the purpose of the input mask without the need to include the zeros before other characters this allowing $4.57 to be input as in this example?



    This is a re-post of a comment on How to Set Content Mask on a Form Field Based on Another Field Input

  • Profile Image
    ashwin_d
    Answered on April 25, 2016 at 06:44 AM

    Hello blakefam,

    "Input Mask" is designed to fill the exact format.

    I would suggest you to please take a look at our "Masked Input" widget and that should fit into your requirement. You have to just configure the number of decimal places. Please check the screenshot below:

     

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • Profile Image
    blakefam
    Answered on April 25, 2016 at 06:44 PM
    Many thanks, however the challenge I am having is accommodating different
    ranges of costs.
    Using an input mask such as $###.## requires each # to be filled,
    irrespective of the value I am wanting to display.
    For example:
    1. If I want to show a cost of $127.65 then the input mask works as desired
    as each # is occupied by a value.
    2. If I want to show a cost of just $5.78, the input mask means I must
    input 005.78 meaning it displays $005.78
    Using the Mask Input wizard does not appear to address this issue.
    I trust this explanation more clearly outlines my challenge with using masks
    Thank you in anticipation of your efforts.
    Bill
    ...
  • Profile Image
    ashwin_d
    Answered on April 25, 2016 at 10:33 PM

    Hello Bill,

    I understood your issue now. Please be noted that if you mask the input as ###.##, textbox will always expect you to input the data in the exact same format including the number of characters as well.

    I am not sure if there is any workaround available to achieve your requirement. I will do few tests and get back to you if I am able to find any workaround.

    Thank you!

  • Profile Image
    bnoreen
    Answered on August 30, 2016 at 10:14 AM

    I'm not sure if there's been an update, but the masked input widget works well now for currency values. If you leave the default settings (no pattern, 2 decimal places, prefix $) it behaves as you would expect, simply moving the digits to the left as you type.

    I agree there should be a more self-explanatory way to accept dollar amounts, but thanks to this forum I found something that works. Now I just have to remember it exists. I'd like to suggest this widget become a standard feature in place of the input mask tool in the future.

    Thanks, JotForm!

  • Profile Image
    Nik_C
    Answered on August 30, 2016 at 12:16 PM

    Thank you for your suggestion and feedback, we appreciate that.

    We'll keep in mind your suggestion for future updates of Masked input widget.

    Thank you again!