# How can I apply advanced calculations to multiple fields?

**District1010**Making great progress with my booking form, thanks to you all at JotForm. Have a small problem though. As you will see from the screenshot I want TotalDinners to reflect DinnerNumbers * FriSatDinners WHEN BothDinners is selected. That would need the BothDinners drop down box to produce either a '1' or a '0'

[{dinnernumbers} * {frisatdinners}] * {bothdinners}

Ultimately I'm hoping that I can bring the other choices into play as well.

What have I missed?

**KadeJM**Hello and thank you kindly for your comments about JotForm. The problem here is that the Calculate Field Feature is only designed for simple math equasions. So for more complex things it's not always going to work because of that unless you use tricks or the form's source code to force it to be much more advanced then what it already is.

I hope you don't mind but I cloned your form to play around with this issue some more to attempt to help you figure out a feasible solution. I can see that you have this set to default valued of 10, 35, 50, 80 as read-only fields so I believe this a major part of the problem since that would disallow the calculation feature to read it and autopopulate it from the inputs. Were those put that way intensionally for being the prices as each? Or?

I decided to play around with this some more and I think that because our field is only designed for simple calculations it does not currently include the default values for a textbox. So because of that you would actually need to include it either via the equasion itself or a number field since I got it to work there. The only problem is that this does not populate when the form first appears so that it's displayed, you actually have to click on it. I think to do that you would have to bring in some parameters to force that maybe. I believe this may take some more time to figure it out as soon as I find out something more that would be a feasible solution.

**District1010**Hi Kade

More than happy that you look at my Form. It's possibly a little more complicated in that the first field 'dinnernumbers' would be self populated in the final version, from the earlier question asking for the Number of Delegates in the first section (there can be up to 12 of them). Thinking about that, if it does work OK in that way then I guess there is nothing to stop having a set of boxes with the rates and selecting whichever one is needed for the equation?

Once I have the results from those fixed value boxes (they are the fixed delegate rates for the conference). Following on from that I hope to have a similar costing exercise for the Delegate Fees. Once that is done I would need to total up the costs and present a Paypal integration.

In an idle moment I have been looking at 'Conditions' which might offer a solution? But, I can't get my head round it at the moment.

Thanks and look forward to your further thoughts.

Peter

- JotForm Support
**jonathan**Hi Peter,

Please test this form

**https://secure.jotform.me/form/40457849894473?**I used both conditions and calculations on the form. I think you can do similar to your form.

Inform us if this method can work for you, and we will assist you create similar calculations.

You can also clone the test form so you can review how I did it.

Use this guide http://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

Thanks.

**District1010**Hi Jonathan

Not sure why but I can't access that form, it won't open and when I try to clone it too gives up - so close and yet so far?

Thanks

Peter

- JotForm Support
**liyam**We apologize for this, Peter.

The domain jotform.me seems to have DNS issues. Our developers have already been informed of this matter. We'll inform you as soon as we have updates on this.

Thanks.

- JotForm Support
**jonathan****@Peter**Hi, I apologize for not realizing the access issue ealier.

You may try testing the form again using this link

**http://www.jotformpro.com/form/40465249202954**instead.Thanks!

**District1010**Hi Jonathan

Seemed to be getting on just fine with your solution except whilst I can make it work with the clone it fails me in the actual form. I have been trying for a few hours now and I suspect I have mised something fairly obvious but for the life of me I can't see it. Would appreciate your assistance.

http://www.jotform.com//?formID=40313863820954

Thanks

**pinoytech**Hi,

I can see that

**"Dinners Total"**field**hidden**once**"Select Dinners"**field is filled. Is this the problem that you are referring?Thanks,

- JotForm Support
**jonathan**Hi Peter,

I will get back to you after I have applied my suggested solution on your form

**http://www.jotformpro.com/form/40313863820954**so you can understand better how I did it.Thanks.

**District1010**Hi Jonathan

Just wondering how you are fixed for time, Your collegue seemed to make sense but I can't see it unfortunately.

Peter

- JotForm Support
**ashwin_d**Hello Peter,

My colleague is currently not available online. He should have received your message and will get back to you once is be back online.

Thank you!

**District1010**Hope Jonathan is OK? Still struggling a little with understanding Conditions I guess and it is the final line that stumps me completely, it obviously works in the sample but not the actual form and as I say it doesn't make sense to me. Help appreciated and there's a long way to go yet before my form is ready for its showing. Also note that the image I've added is the same as my own '?' hope you can see it - it lists the 'Conditions; on the sample form? Working from a Mac if that has any bearing?

Thanks

Peter

- JotForm Support
**jonathan**Hi Peter,

Sorry for the delays.

I noted this problem in your calculation formula for "Select Dinners" which you need to correct.

In

**"calculations, numerical calculation should be enclosed in square brackets "[ ]""**(click image to enlarge)

I also added this condition to properly hide "Dinners Total", which is just a dummy placeholder.

This is my test form again http://form.jotform.me/form/40514972323451?

It will be good practice if you can apply it to delegates "Attending" section also.

Inform us if you still struggle with this and we will be here to assist you all the way.

Thanks!

**District1010**Jonathan

Many thanks, all makes sense so I will hopefully do more with it tomorrow. I must say to give you guys the credit you deserve the service you provide is really good. So much so I suspect that this is really far more technical support than peer support, we don't get a look in!

As for 'conditions' it took a long time to come but now it is really very good and well worth the time taken to master it. Hopefully I will get there, as you suggest it makes sense to use with the 'Attending' Delegates. That was always the plan once the meals are sorted with the final bit being the need to capture the various totals ready for billing. Once done I should be well pleased and raring to move onto the next piece of automation.

Thanks

Peter

PS - Wish we could print these answers - worthy of a new thread?

**District1010**Sorted this one out thanks