# Is it possible to calculate the total price based on options selected by users?

Asked on April 01, 2017 at 11:33 AM

Hi there and thanks for helping

I am a bit familiar with Jotform as I have been making forms for quite long now, I've been trying to build a short price calculation form for my front page website,  to be very similar to the following form (Link), now my question is can this be done with Jotform?

Regards

• Boris
Answered on April 01, 2017 at 12:57 PM

Yes, form calculations are indeed achievable by using JotForm forms. I see that the form is supposed to calculate a total amount based on the pickup location, destination, number of passengers, and similar.

Based on your requirements, you could either accomplish this by using ordinary form calculation fields and calculating values of the selected items:

https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget

https://www.jotform.com/help/301-How-to-Assign-Calculation-Value

Or you could accomplish this with conditional logic - by using insert/calculate type of conditions to output the desired price based on what the user has selected:

https://www.jotform.com/help/268-How-to-Insert-Text-or-Mathematical-Calculation-into-a-Field-Using-Conditional-Logic

Please take a look at the above linked guides on how to perform calculations with your form, and let us know should you need more assistance with any particular calculation you are trying to set up. Thank you.

Answered on April 01, 2017 at 01:02 PM

Thank you very much for your quick respond, I am and can't calculate the values of multiple fields, can you please have a look and let me know what should I do to cal. the values of the (passengers field) and (Places field)? please

https://form.jotformpro.com/70875614394970

• Boris
Answered on April 01, 2017 at 01:34 PM

Thank you for providing the form, I have checked it out, and I see that your conditional logic is set as follows:

The problems here are multiple. The primary one is that these two conditions conflict with each other, at least as they are currently set up.

When you make a selection on the Type of Transfer field, the second condition triggers and passes the value of the select item from Pickup Location.

If you then change the number of passengers, the first conditional gets triggered and it overwrites the calculation with the value of the selected number of passengers.

What I would recommend as the first step is to base both of your conditions on the same field, such as Type of Transfer, and then calculate one amount based if we select "TO SCHIPHOL", and another value if we select "FROM SCHIPHOL".

The second issue is that you are not really calculating the value. With your current conditions, you are simply passing a value from one of the fields into the Price Is field. It seems that what you want to do instead is to calculate a value, such as "Passengers + Pickup Location" or "Passengers + Destination":

Once your conditions are set up successfully, they should appear something like this:

Here is a demo form that you can take a look at, where the conditions have already been corrected:

https://form.jotformpro.com/form/70905451690962

You can clone this modified form back into your own account for closer examination by following this guide:

https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

(The calculation doesn't output any value for the "FROM SCHIPHOL" option as there haven't been any calculation values set up for the Destination field. Once Destination field has its calculation values assigned, it will calculate values as well.)

Please try it out and let us know should you need further assistance.