• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Calculating totals sum?

Calculating totals sum? 14 years 3 months ago #9511

Hi

I've made a web form for ordering clothing items at a triathlon club using the RSformPro. I've got the form up and running.

The from is biuld up so that each clothing item has a size selector and a selector for how many items you should order. The size selector is of drop down type and the number is a text box numeric type

Now, I've made a hidden field where I want the total sum to be calculated as:

Price of item * number of items -> summed of for all items types

eg:

If I have a textbox named "Trisuit" for number of triathlon suits ordered, each at price 200$, and a textbox named "Tripant" for triathlon pants ordered at each 100$

Could I then either in submit button attributes or in the hidden field attributes get a code to sum up the total to

Total = Trisuit*200 + Tripant*100

I'm a bit stuck in how this code should look? Help appreciated!

Regards
Kjell Eirik
Last Edit: 14 years 3 months ago by triathlon.club.bergen. Reason: correcting (some) type errors
The administrator has disabled public write access.

Re:Calculating totals sum? 14 years 3 months ago #9514

  • matt
  • matt's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 136
  • Thank you received: 14
Hi!

Have you tested this tutorial I found in the documentation http://www.rsjoomla.com/customer-support/documentations/34-custom-scripting/89-simple-calculation-with-rsformpro.html it can maybe give you some hints.

Matt
The administrator has disabled public write access.

Re:Calculating totals sum? 14 years 3 months ago #9521

Hi

Yupp, went trough the custom script chapter in the documentation.
Didn't succeed at first. Turned out to be a missing ' and a small type error in one of the field names. Works smoothly now :-)

Used something like this in the submit button attributes field:

document.getElementById('Sum').value = parseInt(document.getElementById('Trisum').value) + parseInt(document.getElementById('Biketopsum').value) + parseInt(document.getElementById('Bikepantsum').value) + parseInt(document.getElementById('Divsum').value);"
The administrator has disabled public write access.

Re:Calculating totals sum? 14 years 3 months ago #9522

looks like ' ) without space gives a smiley....
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!