Hi,
this is about the locked thread https://www.chronoengine.com/forums/posts/f2/t88458/is-it-possible-to-chronoforms-to-add-values-from-fields.html
so I open a new topic.
After I added an Event switcher I notice that total field has to be clicked to show the good result
if not it displays the total value except the last amount edited
eg : if values are 2 / 3 / 1 / 4 / 6
total displays the value for 2 + 3 + 1 + 4 (10)
if user clicks on the field "total" it calculates finally 2 + 3 + 1 + 4 + 6 and displays 16
what could be the problem with the code please ?
this is about the locked thread https://www.chronoengine.com/forums/posts/f2/t88458/is-it-possible-to-chronoforms-to-add-values-from-fields.html
so I open a new topic.
After I added an Event switcher I notice that total field has to be clicked to show the good result
if not it displays the total value except the last amount edited
eg : if values are 2 / 3 / 1 / 4 / 6
total displays the value for 2 + 3 + 1 + 4 (10)
if user clicks on the field "total" it calculates finally 2 + 3 + 1 + 4 + 6 and displays 16
what could be the problem with the code please ?
window.addEvent('domready', function() {
$('total_soiree_restaurant').addEvent('change', rekenen1);
$('total_club').addEvent('change', rekenen1);
$('total_coupe').addEvent('change', rekenen1);
$('total_ski_seul').addEvent('change', rekenen1);
$('total_buffet').addEvent('change', rekenen1);
$('total_soiree_montagne').addEvent('change', rekenen1);
$('total_ski_libre').addEvent('change', rekenen1);
});
function rekenen1(){
$('total_a_payer').value = parseInt($('total_soiree_restaurant').value * 40)+ parseInt($('total_club').value * 15) + parseInt($('total_coupe').value * 30) + parseInt($('total_ski_seul').value * 22) + parseInt($('total_buffet').value * 25) + parseInt($('total_soiree_montagne').value * 60) + parseInt($('total_ski_libre').value * 22)}