Change Calculation Field based on a Text Input

  • HRMink
    Asked on January 27, 2015 at 7:02 PM

    We are going to use stripe to process payments. How we have it set up is we have a calculation field that calculates values of other inputs selected in the form, adds up, and gives a total in that calculation field. Once there is a total, that is copied to the stripe total field.

    What I would like to do is this: Once there is a total in the calculation, have it read a text based input from another field (We will title it Promo Code) and then reduce that total by a certain percentage based on the text input.

    Is this possible? 

  • Charlie
    Replied on January 27, 2015 at 10:04 PM

    Hi,

    Yes I believe that is possible, in my case this is what I have in mind.

    Here's a demo form that I made: http://form.jotformpro.com/form/50267918454967

    1. I added text box fields and form calculation widgets.

    Change Calculation Field based on a Text Input Image 1 Screenshot 50

    2. In the form calculation widget named "Pre-Calculated without Promo Code" I added input 1 and input 2, this will be the total without the promo code.

    Change Calculation Field based on a Text Input Image 2 Screenshot 61

    3. I then setup a condition where when the pre-calculated field is filled, the promo code text box will show. The other condition then will have a rule where when the user adds the promo code "CODE1", it will deduct 5 to the total of precalculated field.

    Change Calculation Field based on a Text Input Image 3 Screenshot 72

     

    From there, you can pass the total form calculation field to the Payment integration wizard.

    Change Calculation Field based on a Text Input Image 4 Screenshot 83

    To not make your form too messy, you can just hide the fields, don't worry, hidden fields will still work, we will just use them as storage for our values.

    You can check my form further by cloning it using this guide: http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL.

    I hope that helps. Do let us know if you need more assistance on this.

    Thank you.