2 simple Condition fields giving wrong answers on a Payment form

  • Profile Image
    LHEDJ
    Asked on October 07, 2016 at 05:25 AM

    I've published the payment form as a Template so ya'll can have a play with it.
    Form Name: Error on Make a Payment (Photography) by LHEDJ
    Template Link: https://www.jotform.com/form-templates/error-on-make-a-payment-photography-by-lhedj

     

    Error Details:
    Visit the Pre-Fill link below.

    The field "Sub Total" adds the Total for 1st, 2nd, 3rd & 4th Child together.

    The field "5% Discount Amount..." is simply ("Sub Total" x 0.05).

    The field "Total Amount Due with 5% Discount" is simply ("Sub Total" - "5% Discount Amount...".

    So why isn't "Total for 4th Child" apart of the calculations??

    Weird thing is, after navigating to the pre-fill link I can delete one of the many "&", hit enter, after it loads click the back button and the form looks fine, but it's the same link??

    Pre-Fill link to form: 

    http://form.jotform.co/form/62682090117857?parentguardiansName[first]=Kyle&parentguardiansName[last]=Lacey&email=kyle@lhe.dj&&&&&&&&&&&&&totalFor12=35&1stChilds13=a%20b&totalFor14=35&2ndChilds=c%20d&totalFor=30&3rdChilds=e%20f&totalFor23=500&4thChilds=g%20h

     

  • Profile Image
    owen
    Answered on October 07, 2016 at 06:44 AM

    Hi, 

    The issue with your form is actually something else. The fields that should be filled are marked as "Read Only" so they are no longer fillable. The calculation issue you are addressing does not exist tough. You used the calculations perfectly well and when the fields are fillable it calculates the amount of discount successfully.

    Once you change the read only statuses of the fields that should be filled your issue should be resolved.

    Please check it and get back to us if the issue still persists. 

  • Profile Image
    LHEDJ
    Answered on October 07, 2016 at 11:13 AM

    I originally posted the working screenshot by accident, above is now the error shot.
    The fields are Read Only because the info comes from an order form. I'm sure if the person paying could change the amount payable I'm sure they'll try.
    I've since identified the problem field is "Total for 4th Child"


    Total for 1st, 2nd & 3rd Child = 100
    The Discount & Total Due are right for these fields but clearly not the for the 4th.

  • Profile Image
    Kiran
    Answered on October 07, 2016 at 02:06 PM

    I have checked your JotForm and the URL being used. I notice that the 4th Child field name is incorrectly used as totalFor18 where the correct field name is totalFor23.

    http://form.jotform.co/form/62682090117857?parentguardiansName%5Bfirst%5D=Kyle&parentguardiansName%5Blast%5D=Lacey&email=kyle@lhe.dj&&&&&&&&&&&&&totalFor12=35&1stChilds13=a%20b&totalFor14=35&2ndChilds=c%20d&totalFor=30&3rdChilds=e%20f&totalFor18=500&4thChilds=g%20h

     

    Could you also try using Calculation widgets to perform the calculation instead of using conditions on a text field to see if that helps? 

    Let us know how it goes. We will be happy to assist you further. 

  • Profile Image
    LHEDJ
    Answered on October 07, 2016 at 11:09 PM

    Thanks Kiran,

    I tried replacing the "Total for 4th Child" field and didn't update the Pre-Fill link, sorry.

    I tried using a Calculation widget but got the same error result.

    I can see that the "Total Amount Due" field has taken an invisible amount of 30 (which is 5% of 600) and 3.5 (which is 5% of the 1st & 2nd child) from 100 (which is the total of the 1st, 2nd & 3rd Child)

  • Profile Image
    Kiran
    Answered on October 07, 2016 at 11:31 PM

    Since it is a calculation field, the calculations cannot be completed as the form loaded. However, a focus out or key press would get the calculation done. I have cloned your JotForm to my account and replaced the text fields with calculation fields to avoid conditions. Also, I added a page break so that the calculation on the form shall be done.

    Please see the link below:

    http://form.jotform.co/form/62805562663965?parentguardiansName%5Bfirst%5D=Kyle&parentguardiansName%5Blast%5D=Lacey&email=kyle@lhe.dj&&&&&&&&&&&&&totalFor12=35&1stChilds13=a%20b&totalFor14=35&2ndChilds=c%20d&totalFor=30&3rdChilds=e%20f&totalFor23=100&4thChilds=g%20h

    You may clone the form again to your account to see how it works.

    Please check and let us know if you need any further assistance. We will be happy to assist. 

     

  • Profile Image
    LHEDJ
    Answered on October 08, 2016 at 12:46 AM

    Thank you so much Kiran,

    I tried something similar regarding your suggestion that calculations don't always work on loading the Pre-fill, by adding a Check Box that completes the calcs :-)

    Cheers mate

  • Profile Image
    Mike_G
    Answered on October 08, 2016 at 01:40 AM

    On behalf of my colleague, Kiran, you're most welcome. I believe it is safe to say that your issue is not fixed. Please feel free to contact us anytime, if you have any other questions or concerns. 

    Thank you.

  • Profile Image
    LHEDJ
    Answered on October 08, 2016 at 02:23 AM

    issue is fixed :-)