waby
Member
Hi,
In the form, how can I do in Javascript the sum of repeatable elements and display the result in another element ?
I have tried this
function sumQuantity(){
var qty0 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_0').getValue();
var qty1 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_1').getValue();
var qty2 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_2').getValue();
var totalqty = parseFloat(qty0) + parseFloat(qty1) + parseFloat(qty2);
form_30.formElements.get('jml_fb_mp_orders___shipping_cost').update(totalqty);
}
But it works only if the element is repeated one time minimum...
Any support will be appreciate...
Regards,
Eloise
In the form, how can I do in Javascript the sum of repeatable elements and display the result in another element ?
I have tried this
function sumQuantity(){
var qty0 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_0').getValue();
var qty1 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_1').getValue();
var qty2 = form_30.formElements.get('join___70___jml_fb_mp_orders_contents___unit_quantity_2').getValue();
var totalqty = parseFloat(qty0) + parseFloat(qty1) + parseFloat(qty2);
form_30.formElements.get('jml_fb_mp_orders___shipping_cost').update(totalqty);
}
But it works only if the element is repeated one time minimum...
Any support will be appreciate...
Regards,
Eloise