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

    Count digits in number to multiply for a cost?

    Asked by jenebo on September 14, 2015 at 11:54 AM

    For example, we have a badge number 10150. Instead of Jotform reading it as 10,150, we would like it to count the numbers so it should read the number 5 for the 5 digits, then we can multiply the 5 digits by the $1.25 per digit for a total. Is there a way to do this?

    count digits in a
  • Profile Image
    JotForm Support

    Answered by Charlie on September 14, 2015 at 03:30 PM

    Hi,

    May we know how the badge number is generated? Is it being typed on one text box field? Or is generated by clicking radio buttons or check boxes? I believe the conditional logic should be able to do this, but depending on how you setup things.

    This can be also be done by adding a custom Javascript code in your form's full source code to count the numbers. Here's a Javascript function that does that: http://www.w3schools.com/jsref/jsref_length_string.asp.

    We'll wait for your response.

  • Profile Image

    Answered by jenebo on September 14, 2015 at 04:12 PM

    The badge number is typed in by the user.

  • Profile Image
    JotForm Support

    Answered by Chriistian on September 14, 2015 at 11:34 PM

    Hi,

     

    As suggested by my colleague, you can achieved this by adding conditions in your form. You can check this sample form that I have created - http://form.jotformpro.com/form/52568689768986. See screenshot below for the Condition setup of the form I implemented.

     

    Do let us know if you need further assistance.


    Regards.