What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

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.


  • Profile Image

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

    Asked by pwregalado on January 06, 2017 at 05: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!

    Page URL:
    https://form.jotform.com/63468000914957

  • Profile Image
    JotForm Support

    Answered by Chriistian on January 06, 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.

    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:

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

    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

     

    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.