Hello
I've searched in the forum and the wiki on a way to do this, but it seems its not working for me, here is what i need to achieve:
I have a repeating group with 2 fields one for quantity and other for amount (this one is autofilled with autofil plugin). Now on another non repeating group (in the same form) i have a calc element where i want to show the total value of the sum of the other 2 values, typical cost calculation.
I read this wiki page: http://fabrikar.com/forums/index.php?wiki/form-javascript/#calculating-cost-in-a-repeat-group
Followed the steps but its not clear to me what should be the total element, is it a field? a calc? i have right now a calc but im not getting any result. This is my code i have setup as a onchange event on both quantity and amount elements:
Regards.
I've searched in the forum and the wiki on a way to do this, but it seems its not working for me, here is what i need to achieve:
I have a repeating group with 2 fields one for quantity and other for amount (this one is autofilled with autofil plugin). Now on another non repeating group (in the same form) i have a calc element where i want to show the total value of the sum of the other 2 values, typical cost calculation.
I read this wiki page: http://fabrikar.com/forums/index.php?wiki/form-javascript/#calculating-cost-in-a-repeat-group
Followed the steps but its not clear to me what should be the total element, is it a field? a calc? i have right now a calc but im not getting any result. This is my code i have setup as a onchange event on both quantity and amount elements:
Code:
var i = this.id.match(/_(\d+)$/)[1];
document.id('join___4___kamu_pedidos___total_'+i).value = parseFloat(document.id('join___4___kamu_pedidos_10_repeat___cant_'+i).value) * parseFloat(document.id('join___4___kamu_pedidos_10_repeat___cant_'+i).value);
Regards.