Auto format short text field for $ and decimal point

  • ITSupportdesk
    Asked on April 25, 2024 at 2:02 PM

    Is there CSS code that will take a numerical entry in a short text field that has a numerical value that comes from a conditional calculation and add the dollar sign and a two place decimal? So, an entry or calculation of 234 will appear as $234.00 or 234.3 will appear as $234.30. I know the masked input widget will perform this function, however, it is not an accessible widget and my forms must be accessible.

    Jotform Thread 14271061 Screenshot
  • Gaud JotForm Support
    Replied on April 25, 2024 at 2:57 PM

    Hi Arizona State Schools for the Deaf and Blind,

    Thanks for reaching out to Jotform Support. I've checked out the screenshot you shared with us. Yes, it is possible to add the $ in the short text to get the result in $234.00 or 234.3 format. Let me show you how:

    1. Open your form in the Form Builder and click on the black gear icon for the Short Text Field to open the Short Text Properties panel.
    2. Click on the Options tab, then turn the toggle on for the Input Mask.
    3. Enter $###.# and close the panel. That's it. Auto format short text field for $ and decimal point Image 1 Screenshot 30

    Auto format short text field for $ and decimal point Image 2 Screenshot 41

    Let us know how it goes.

  • ITSupportdesk
    Replied on April 25, 2024 at 5:34 PM

    Hi Gaud,

    When I enter that input mask into the field it limits the field to that number of digits, i.e. $###.## requires the entry of $100 up to $999, nothing else. My goal is to have the submitter enter any number in the short text field i.e 1 and format it to $1.00 or 10 to $10.00 and so on.

  • Gaud JotForm Support
    Replied on April 25, 2024 at 6:24 PM

    Hi Arizona State Schools for the Deaf and Blind,

    Thanks for getting back to us. Unfortunately, it will not be possible to achieve this using the short text field. Instead, you can use the Form Calculator Widget. Let me show you how:

    1. Open your form in Form Builder, and in the orange navigation bar at the top of the screen, click on Add Form Element.
    2. Click on the widgets. Search for the Form Calculator widget. Drag and drop it on your form.
    3. Click on the Magic Wand icon, add the $ as a string, and then select Add Fields button.
    4. Choose 92 to 98 and add the + sign in between, after 98 do not add the +.
    5. Click on the options button in the blue gear icon.Auto format short text field for $ and decimal point Image 1 Screenshot 50
    6. Click on Show empty decimal places. Select Go back.Auto format short text field for $ and decimal point Image 2 Screenshot 61
    7. Click on the Save button, that's it. Auto format short text field for $ and decimal point Image 3 Screenshot 72

    Auto format short text field for $ and decimal point Image 4 Screenshot 83

    Let us know how it goes.

  • ITSupportdesk
    Replied on April 25, 2024 at 6:45 PM

    Thank you Gaud, you've been a great help.

 
Your Answer