Calculate Total of Drop down field

  • Profile Image
    jamesforpm
    Asked on September 12, 2014 at 06:57 AM
    To recreate this set up, what type of field should the Grand Total field be? 
  • Profile Image
    EltonCris
    Answered on September 12, 2014 at 09:29 AM

    Hi,

    Would you mind elaborating your question?

    If you want to include drop down values in the calculation, I would recommend assigning calculation values in each of the options under its properties.

    And here's how to perform calculation in the form. http://www.jotform.com/help/259-How-to-perform-calculation-in-the-form

    If you have further questions, let us know.

    Thanks!

  • Profile Image
    jamesforpm
    Answered on September 12, 2014 at 11:18 AM

    Hi,

    I'm trying to recreate the JS solution that was provided here: http://www.jotform.com/answers/202265

    Unfortunately the built-in drop down calculation functionality will satisfy my requirements but a JS solution might. See more here: http://www.jotform.com/answers/427514-Help-with-complicated-conditional-calculations#5

    So my question is, is there anything special about the Grand Total field? Is it just a read-only text entry field?

    Also, I cloned the form from this solution http://www.jotform.com/answers/202265 and added the custom JS to the source HTML but the calculation does not work. Is there a reason why this solution would not work any more?

    Thanks.

  • Profile Image
    david
    Answered on September 12, 2014 at 12:55 PM

    There is nothing special about the Grand Total field in the form you referenced.  It is indeed just a read on text box.  When the form is cloned the field ID's may not be the same.  Since the script references specific field ID's:

    var efee = document.getElementById("input_10"),
    cfee = document.getElementById("input_11"),
    extraz = document.getElementById("input_13"),
    clazz = document.getElementById("input_14"),
    gtotal = document.getElementById("input_28");

    If these ID's do not match the input ID's for your form, the calculation will not be made. Other than that. There should be no reason why that solution should not still work.