Can I keep the leading zeros of numbers in a text field?

  • pwregalado
    Asked on January 6, 2017 at 5:28 PM

    I'm working with form that needs to sort through a bunch of different combinations of checkboxes, and to simplify the process I'm converting the combinations to a binary form (eg, 1001101, 0001101, etc). The only issue is when I pass Calculation Values from the checkboxes to a Textbox Field, it condenses the numbers that begin with 0. Is there any way to force it to keep the zeros at the beginning?

    Thank you!

  • Chriistian Jotform Support
    Replied on January 6, 2017 at 10:40 PM

    You can try to add a Form Calculation widget and directly transfer the value of the Options checkbox to the calculation widget as text so you can have the 000's displayed on the field. For more information about calculation widget, you can check this article: How to Perform Form Calculation Using a Widget.

    Can I keep the leading zeros of numbers in a text field? Image 1 Screenshot 70

    Can I keep the leading zeros of numbers in a text field? Image 2 Screenshot 81

    Ensure that the added field in the calculation widget is set to A-Z as shown above so the value will be inserted as text. Here is how the field will look like in your form:

    Can I keep the leading zeros of numbers in a text field? Image 3 Screenshot 92

    However, this method will not work when you select multiple options. It will display the values as comma delimited as shown below.

    Can I keep the leading zeros of numbers in a text field? Image 4 Screenshot 103

    As a workaround, you can try to ad different textbox for the value of the different options. The value for the checkbox will be 0 or 1 only. Here is a sample form that you can check to see if this is what you are looking for: https://form.jotform.com/70058958545972

    Can I keep the leading zeros of numbers in a text field? Image 5 Screenshot 114

    Can I keep the leading zeros of numbers in a text field? Image 6 Screenshot 125

     

    You can clone the sample form that I have created to have a closer look on the setup. To clone the form, you can follow the instructions provided in this article: How to Clone an Existing Form from a URL.

     

    Do let us know if you need further assistance.
    Regards.