Easy way to change the total on a paypal purchase

  • Profile Image
    eman_no1
    Asked on August 02, 2014 at 03:21 PM

    Hello,

    I am making a form to enroll students. The form allows for up to 3 students, how do I make a javascript that checks the first and last name for students 2 and 3 and increments the enrollment total accordingly.

    Example Form:

    Student 1: $135

    Student 2: Has First Name == True & Has Last Name == True: Add $135

    Student 3: Has First Name == False & Has Last Name == False: Add $0

    Total $270

     

    Thanks,

     

    - Erik

  • Profile Image
    Welvin
    Answered on August 02, 2014 at 05:41 PM

    Hi Erik,

    Please check this clone version of your form: http://www.jotformpro.com/form/42136447455961. You'll noticed the textbox fields and the calculation widget at the bottom. Fill the second and third child's name. You'll see the results in the Payment box.

    Let me know if this is what you are trying to do so I can give you the steps.

    Thanks

  • Profile Image
    eman_no1
    Answered on August 02, 2014 at 11:23 PM

    Thanks Welvin, that is exactly what I am looking for.

    -Erik

  • Profile Image
    Welvin
    Answered on August 03, 2014 at 03:34 AM

    You can have the same by following the steps below:

    1. Add two Textboxes to the form

    2. Add a conditional logic to insert a number to these fields. You have to add a separate logic to each child (2nd and 3rd). Please refer to this guide: https://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Caculation-into-a-field-using-a-Condition. The conditional logic should be "IS FILLED", for example:

    3. Add the Calculation Widget. In the calculation section, simply sum up the two textboxes + 135 for the first child (by default). See screenshot:

     

    4. Lastly, run the payment wizard and make sure to select "Donation" then get the amount from the calculation. Check this visual guide:

     

    That's it! You're done! You can also simply clone my form above by following this guide: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL and use it.

    If you require any further assistance, feel free to let us know here!

    Thank you!