Difficulty creating Calculated field called "Total Payment Amount"

  • cbchaganti
    Asked on June 2, 2016 at 9:45 AM

    I am trying to create a field called Total Payment Amount and having difficulty. 

    Here is my requirement. 

    If "Primary Name" is filled - Payment amount = $175  (By default)

    If "Spouse Name is filled - Additional Amount = $50 and If children are entered

                 1st additional child = $50; 2nd additional child = $25; 3rd additional child = Free

    if Spouse Name is Empty and If Children are entered

                1st additional child = $50; 2nd additional child = $50; 3rd additional child = $25

    In other words, depending upon total number of family registered equals

    1 - $175; 2 - $225; 3 - $275; >3 - $300

    Here are the steps I took.

    1. Clicked on Form Calculation that added a field called Count Spouse

    2. Added two conditions that If Spouse Name is empty, Count Spouse = 0; if it is filled Count Spouse=1

    3. My idea was to compute total members by adding {Count Spouse} + {# of Children} + 1.  But this is not working.  It is showing the text 2+1+1 rather then 4.  

    Can you let me know how to solve my final goal?

     

    Thanks

    CB

     

  • beril JotForm UI Developer
    Replied on June 2, 2016 at 11:31 AM

    If you want to create payment form you need to create our Payment tools to ask payments. At that situation, you can create multiple products by using our payment integration.

    Please note that asking credit card information is not possible with JotForm and asking credit card information which is against our terms of use. You can setup a form to collect details such as name, address, email address and other non-sensitive information.

    If you want to pass calculation to your payment form it is possible with JotFom. Please, check the guide below for more information:

    https://www.jotform.com/help/275-How-to-pass-a-calculation-to-a-payment-field

    If you have any question or issue, please do not hesitate contactin us we will be happy to assist you.

  • cbchaganti
    Replied on June 2, 2016 at 11:36 AM

    NO I am not trying to setup a payment option.  All I want to show is what would be the total amount to the person filling  the form.  My question was how do I create a calculated field based on other input fields.  I looked at some of the examples through this forum, and followed them but still correct value is not being displayed.  Instead of showing the computed value of 4, it is showing 2+1+1

  • victor
    Replied on June 2, 2016 at 1:03 PM

    To accomplish your task I have create different condition and added extra text fields to get the value when certain fields are filled. You may clone the form so you can analyze it better.

    https://form.jotform.com/61534651132953

    The following condition verify that the fields are filled and place a value on textboxes

    Difficulty creating Calculated field called Total Payment Amount Image 1 Screenshot 30

    Once you have the proper values, you can use the form calculation field to calculate the total amount for the user.

    Difficulty creating Calculated field called Total Payment Amount Image 2 Screenshot 41

    Please let us know if this helps.

  • cbchaganti
    Replied on June 2, 2016 at 1:36 PM

    Thank you for the quick response.  Just one more issue:

    1. First time when you check the "Additional Members - SPOUSE", it shows the Spouse details section and related fields.  I entered them and it correctly displayed the TotalSpouse = 50; 

    2. Then when I UNChecked the "Additional Members - SPOUSE",the TotalSpouse = 50 is still displayed.  I guess that is because the SpouseName is still filled although the whole section is hidden.

    How should we clear he entries of Add Spouse Section when "Additional Members - SPOUSE" is UNCheckd?

     

    Same problem for "Additional Members - CHILDREN"

     

    Thanks

    CB

  • Charlie
    Replied on June 2, 2016 at 2:39 PM

    You can clear the values of conditionally hidden fields by navigating to your Preferences->Advanced tab->Click "Show More" button->Change the option in "Clear Hidden Field Values" to "Clear on Being Hidden". Here's a screenshot to where to find it:

    Difficulty creating Calculated field called Total Payment Amount Image 1 Screenshot 20

     

    Now when fields are conditionally hidden, their values will reset.

    Let us know this works for you.