calculate fields in an ADDT form?
Posted: 2012-11-07 14:38
Hi all,
I need to add some calculation to a custom form created using ADDT (but it is the same for MX Kollection pro).
I have a custom/simple order form where there area few fields that need calculations.
Example:
qty1
item1_description
item1_price
item1_totalprice
In this case I need to calculate item1_totalprice bu multiplying qty1 and item1_price.
I actually use some javascript to do the calculation but I cannot make it to work.
Here is my JS code:
Then in my form I add the onchange"tot()" call to my fields.
But nothing happens.
I have another page that has similar calculations but it works there. I cannot any difference.
Any idea?
TIA
tony
I need to add some calculation to a custom form created using ADDT (but it is the same for MX Kollection pro).
I have a custom/simple order form where there area few fields that need calculations.
Example:
qty1
item1_description
item1_price
item1_totalprice
In this case I need to calculate item1_totalprice bu multiplying qty1 and item1_price.
I actually use some javascript to do the calculation but I cannot make it to work.
Here is my JS code:
Code: Select all
function tot() {
var imp1=(document.form1.qty1.value-0)*(document.form1.item1_price.value-0)
document.form1.item1_totalprice.value=imp1
But nothing happens.
I have another page that has similar calculations but it works there. I cannot any difference.
Any idea?
TIA
tony