Hi,
I am developing an order form (pls see attached picture), where some things have to summed up and so on.
I have managed to fulfill a few of my tasks, e.g. price * quantity. However, i've problems summing all things up at the end of the form. It works when i disable quantity calculation.
This is my js code:
Do you see the problem? I've been looking for hours now... :-(
Thank you for your help
I am developing an order form (pls see attached picture), where some things have to summed up and so on.
I have managed to fulfill a few of my tasks, e.g. price * quantity. However, i've problems summing all things up at the end of the form. It works when i disable quantity calculation.
This is my js code:
window.addEvent('domready', function() {
$('epreis1').addEvent('change', epreis1);
$('anzahl1').addEvent('change', anzahl1);
});
function epreis1(){
$('gpreis1').value = $('anzahl1').value * $('epreis1').value ;
}
function anzahl1(){
$('gpreis1').value = $('anzahl1').value * $('epreis1').value ;
}
window.addEvent('domready', function() {
$('epreis2').addEvent('change', epreis2);
$('anzahl2').addEvent('change', anzahl2);
});
function epreis2(){
$('gpreis2').value = $('anzahl2').value * $('epreis2').value ;
}
function anzahl2(){
$('gpreis2').value = $('anzahl2').value * $('epreis2').value ;
}
window.addEvent('domready', function() {
$('gpreis1').addEvent('change', summe);
$('gpreis2').addEvent('change', summe);
});
function summe(){
$('summe').value = $('gpreis1').value * $('gpreis2').value; // "*" here for testing purpose only
}
Do you see the problem? I've been looking for hours now... :-(
Thank you for your help