No announcement yet.

Custom javascript incorrectly multiplying by 10

  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom javascript incorrectly multiplying by 10

    Hello everyone.

    I'm attempting to create a dynamically calculating travel reimbursement form, and I'm having an issue with one particular field.
    It's a bit complex, so I attached the file I'm working with. It's not completely finished yet, but most of the calculations are implemented.

    My issue is with the field called Page2TotalVendorPaidDirectly. It is inexplicably multiplying the total by 10. It should collect the expenses from each field where Vendor Paid Directly is selected in the corresponding dropdown, which it seems to do correctly, but then it multiplies the total by 10 for no apparent reason.

    The other 2 total fields (Page2TotalCreditCard and Page2TotalEmployeeReimbursement) appear to be working as intended. The weirdest bit is that Page2TotalVendorPaidDirectly (the field that is not working properly) was the first one that I created and tested. Once I got it working, I copied the javascript to the other 2 total fields only changing the appropriate dropdown selection.

    Any help is appreciated.
    Attached Files

  • #2
    Issue resolved.

    I'm not sure what the underlying problem was. I started a fresh file (I had deleted an unneeded page from the original document after creating all the calculating fields), which did not solve the problem.

    For some reason, the thing that fixed the issue was setting the default value to all fields involved in the calculation to 0.