• 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: Calculation with radiobutton

Calculation with radiobutton 10 years 1 month ago #30850

  • filippo.bracci
  • filippo.bracci's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 11
  • Thank you received: 1
Hello everybody,

I have another little problems with calculations between fields.

My website is about MTB in Italy and I have a form where you can book one of these tours www.ridemontaione.com/it/tour-guidati-mt...iscrizione-tour.html

In this form, depending by the tour you select from the dropdown menu you have several options.

In particular, if you select the tour "Montaione e il suo territorio (facile)" you can see that appears some options (calendar, and so on…).

You can see the radiobutton where you can select a wine tasting YES or NOT.
This radiobutton (that appear only in this tour "Montaione e il suo territorio (facile)") is included into the calculation of the total cost of tour and it has these parameters: YES=[p8] and NO=[p0].

Now, if you select this tour and you select YES the wine tasting "degustazione" and the number of participants, in the bottom of the form (in the green area) you can see the calculation of the total cost of the tour.

In fact the total cost of the tour is made by: ({tour:value + degustazione:value})*{participants:value}

But, if you decide to change the tour and you select for example "Montaione e il suo territorio" which has not the radiobutton you will see that the system keep in cache the selection of the radiobutton on YES=[p8] and it adds/sums at the value of the tour "Montaione e il suo territorio" which is [p30] giving a wrong total.

How can I solve this issue? Because otherwise the user get a wrong rate...

Thanks a lot again for your very kind support and help!

Filippo
The administrator has disabled public write access.

Calculation with radiobutton 10 years 4 weeks ago #30925

  • bogdan.tataru
  • bogdan.tataru's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 174
  • Thank you received: 40
This is happening because you choose "Montaione e il suo territorio (facile)" and YES to "Vuoi includere una degustazione di prodotti tipici?", but you never unselect that option even when you choose another "Tour Guidato".
Head to Components >> RSForm! Pro >> Manage Forms and choose your form. Edit the "tourguidato" dropdown and on Attributes tab add
onchange="myFunction(this.value)"
in the Additional Attributes field. On the Properties tab click on CSS and Javascript and add the following script in the Javascript field:
<script>
function myFunction(val) {
    if(val!="Montaione e il suo territorio (facile)"){
     document.getElementById('degustazionesino0').checked=false;
     document.getElementById('degustazionesino1').checked=false;
     rsfp_Calculations3();
    }
}
</script>
In this function we verify the value of "tourguidato" dropdown and call for the function that reinitialize the price.

I hope it will do the job for you.
My help is not official customer support. To receive assistance, submit a ticket by clicking here
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!