Input Mask: How to Allow Optional Numbers Without Leading Commas in Currency Fields?

  • M
    Mark Tanaka
    Asked on October 26, 2025 at 9:03 PM

    Which masked letter do I use for a number which can be a blank? For example, if a currency value input is requested, "#,###,###" will not allow 200,000, or 10,000. By the way, I don't want to show preceding commas such as in ',10,000' for an input of '10000'.

  • Profile Image
    Sheena JotForm Support
    Replied on October 27, 2025 at 2:27 AM

    Hi Mark,

    Thanks for reaching out to Jotform Support. With the input masking feature in Jotform, you use specific characters to control what users can enter:

    • # masks numbers (digits only)
    • @ masks letters
    • * masks letters and numbers

    For your case, where you want to allow numbers like 200,000 or 10,000 but also allow blanks, and avoid showing preceding commas such as ',10,000', the standard mask like "#,###,###" will not work because it expects all positions to be filled. Unfortunately, Jotform's input mask does not support optional numeric positions directly in the mask to allow blanks in between or before numbers without showing commas.One workaround is to use a Short Text field with input mask enabled and use the # mask for numbers, but you may need to handle formatting and validation with custom scripts or calculations outside the mask.

    Alternatively, you can allow users to enter numbers without commas and then format the number using calculations or integrations after submission. You can add the commaSeparate() function in the Form Calculation widget to format numbers with comma separators for easier readability of dollar amounts. Here’s how to do it:

    1. In Form Builder, click on the widget's wand icon to open its properties.
    2. Click on f(x) icon and add the fields inside the commaSeparate() function.
    3. Click on Save and you're done.

    Input Mask: How to Allow Optional Numbers Without Leading Commas in Currency Fields? Image 1 Screenshot 30

    Result:

    Input Mask: How to Allow Optional Numbers Without Leading Commas in Currency Fields? Image 2 Screenshot 41

    Give it a try and let us know if you need any help.

Your Reply