JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to set the content mask input to just set the decimal places not the leading values?Asked by blakefam 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
"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.
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.
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.
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.
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.
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!