How to perform calculation with a checkbox

  • dotransferme
    Asked on January 17, 2017 at 9:27 AM

    Please be so kind to advice me how we can add price (for example $50) to the total price when customer check checkbox.

     

    To be sure You understand what we are talking about: We have checkbox field "Order VIP Transfer" (this is optional field) when customer check this field we want system to add automatically $50 to "Transfer Price" field which already have some price based on user's selected two drowdowns 

    https://form.jotform.me/70155223802446

  • Support_Management Jotform Support
    Replied on January 17, 2017 at 9:42 AM

    Since you're done assigning the value of 50 to your Order VIP Transfer checkbox, all that's left now is to copy its value to the Total Price textbox.

    Just create a condition as follows:

    How to perform calculation with a checkbox Image 1 Screenshot 30

    RESULT:

    How to perform calculation with a checkbox Image 2 Screenshot 41

    I strongly recommend you review the guides below to have a better grasp of how to perform Calculations:

    How-to-Perform-Calculation-in-the-Form

    How-to-Assign-Calculation-Value 

  • dotransferme
    Replied on January 17, 2017 at 10:18 AM

    Thanks for your reply. The problem is that it dos't work the way we need it. We need this 50$ to be added to the sum (price) which will be already in Total Price field!

  • dotransferme
    Replied on January 17, 2017 at 10:28 AM

    and one more thing! when we unchecked "Yes, I need VIP Transfer!" the price in total price do not changes it stays same which was when we checked "Yes, I need VIP Transfer!"

  • Ashwin JotForm Support
    Replied on January 17, 2017 at 12:01 PM

    Hello dotransferme,

    The easiest way to achieve your requirement is by adding "Form Calculation" widget in form. You can add formula to show sum of "Total Price" and the calculation value of checkbox field as well. 

    Please take a look at the following cloned form where I have made the required changes and see if this works as expected:  https://form.jotform.com/70164486436965

    Feel free to clone this form for a closer look. The following guide should help you in form cloning:  https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • dotransferme
    Replied on January 17, 2017 at 2:33 PM

    Dear ashwin_d, Thank you a lot for such detailed assistance! Now form is working properly and we will made our changes to customize form.

     

    There is only one question left! Price output field (the number which it output) can be changed manually and user can change price and for example: instead of $100 he/she can pay 1 or 5 $ and status of order will be payed for the system and someone must manually check it for each order.

     

    Question is: Can we made this section (with same functions which it already have) red only or maybe there is some other solution to make this outputted number  not editable for user?

     

    Thank you one more time for your assistance in this matter and hope to hear from you concerning unmentioned question.

  • Support_Management Jotform Support
    Replied on January 17, 2017 at 3:51 PM

    You may set the Form Calculation Widget as read-only. Just click the WAND icon for that field > click the ... option > then the OPTIONS tab > and tick the RESULT FIELD IS READ ONLY checkbox.

    How to perform calculation with a checkbox Image 1 Screenshot 30

    How to perform calculation with a checkbox Image 2 Screenshot 41