What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
Change Calculation Field based on a Text InputAsked by HRMink on January 27, 2015 at 07: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?
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.
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.
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.
From there, you can pass the total form calculation field to the Payment integration wizard.
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.