How can I use calculation in my form?

  • Profile Image
    technisourcetraining
    Asked on November 22, 2017 at 04:38 PM

    Hello,

    I have tried a few different widgets and such, but cannot find something that will allow me to have a read-only result based on a few field inputs. What I want to do is have three fields:

    - How many people to be trained

    - How many people per training session

    - How many hours are needed per training session

    I then want a read-only field that will calculate these three fields like this:

    (#1/#2)*(7/#3)

    Basically, we have a 7-hour workday. What I want to figure out is how many sessions we can squeeze into a 7-hour work days based on the length of each session. Then, how many days will it take to train all of the sessions.


    Thanks,


    Kevin

  • Profile Image
    Sabbir
    Answered on November 22, 2017 at 05:08 PM

    Please follow this screencast to know how to implement this calculation:

    1511388179hourcalculation.gif

    You can follow this guide to know more about form calculation:

    https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

    To make the calculation field readonly, please inject the following css in your form builder's CSS tab:

    #input_11
    {
      pointer-events: none;
    }

    Follow this link to know how to inject custom css in your form:

    https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    Here #input_11 is the id of my calculation control. In your case, this id will be different.

    Please refer to this guide to know how to get your calculation field id:

    https://www.jotform.com/help/146-How-to-Find-Field-IDs-and-Names

    Hope this will help.

    If you have any further query or issue, please let us know.