Forums

Show the sum of selected values on confirmation page

Bandola 22 Jan, 2013
Hi!

I have a registration form for an event. The participants can choose if they want hotel, ticket for soccer game etc. We will send them an invoice after we got their request.

It would be nice if we could show the total sum based on their values on the confirmation page and the e-mail they get.

Example.
The fee is 100 E (fee), the hotell is either 50 or 100 (hotel) and if they want a ticket (y/n) they pay 25 E (ticket)

Someone who register for the course and chose the cheaper hotel and wants a ticket then should pay: 100+50+25=175 E. There is also a tax of 6%. So how can I get the sum of the fields fee, hotell and ticket and also multiple that with 1.06?

I want that sum to be displayed on the confirmation page like "You will pay 185,5 E inc VAT".

Kind regards
Ola

Ps - I love this component!
GreyHead 22 Jan, 2013
Hi Ola,

There are two ways to do it (and you may need both):

a) You can add JavaScript to your form to calculate the total and display it whenever one of the inputs that affects the total changes.

b) You can add PHP to a Custom Code action after the form submits and calculate the total there.

You may need both because a) is more useful to the user - but can be hacked and b) is less useful to the user but more secure and reliable.

Bob
Bandola 22 Jan, 2013
Hi Greyhead!

Ok - and since I am no coder I am stuck...?

Or do you know of any sample code I can modify? I guess I am not the first one with this request?

Kind regards
Ola
GreyHead 23 Jan, 2013
Hi Ola,

It's fairly easy for someone with some coding experience. Maybe there's a friendly student around?

If you search the forums here on 'calculate' or 'calculation' you'll find several examples. Unfortunately every form and every calculation is a bit different so the code needs to be written for your form.

Bob
Bandola 23 Jan, 2013
Hi!

I tried to find other post but with no success.😟

I guess I have to wait with this then.

Thanks anyway!
Ola
GreyHead 24 Jan, 2013
Hi Ola,

If I use the ChronoSearch and type 'calculate' I get nearly 250 results.

Bob
This topic is locked and no more replies can be posted.