Sum values of diffrent radiogroups

Hey
Currently I’m trying to make on my website an interface which should show the final price of a product depending on its configuration. I’ve already managed it connect the radio buttons via a dataset to the textboxes in the bottom left corner. Now I’d like to sum all the values of the columns in the dataset(movement, material, fees) to get the final price and show that in a textbox. Javascript is new to me and I tried it the whole afternoon but I haven’t found a working solution. Could anyone help me out?

Hi Niklas,

I want to draw your attention to a few dataset functions that can be used for this purpose:

https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValue
https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#save

The total price element could be explicitly set too. It would be the text property if it’s a text element, and the value property if it’s an input box. A typical assignment statement based on assumed names for your elements would go like this:

$w("#TotalPrice").value = $w("#Movement").value + $w("#Material").value + $w("#BasicPrice").value;

You will have to play with it a bit to see how everything works.