Calculating form has options and based on what the client enters determines what products load in a sidebar. Products are given a quantity that directly reflects that value of the option.
So now per product there is a Total Price, Total Duration and Total Number of Dives as seen here.
num1=Number(document.getElementById('product_quantity_' + productid).value);
num2=Number(document.getElementById('product_price_' + productid).value);
nums=num1*num2;
document.getElementById('product_price_total_' + productid).value = nums;
num1=Number(document.getElementById('product_quantity_' + productid).value);
num2=Number(document.getElementById('product_duration_' + productid).value);
nums=num1*num2;
document.getElementById('product_duration_total_' + productid).value = nums;
num1=Number(document.getElementById('product_quantity_' + productid).value);
num2=Number(document.getElementById('product_dives_' + productid).value);
nums=num1*num2;
document.getElementById('product_dives_total_' + productid).value = nums;
num1=Number(document.getElementById('product_quantity_' + productid).value);
num2=Number(document.getElementById('product_hire_' + productid).value);
nums=num1*num2;
document.getElementById('product_hire_total_' + productid).value = nums;
So now we need a script that gives us the Grand Total Price of all of the — ‘product_price_total_’ + productid).value — and another for Grand Total Duration, and a third for Grand Total Dives etc.. etc…
Not sure how but a few ideas would be an array that added up only fields with a specific alt tag or title tag.
Anyone got any ideas.
Thanks
How about something like this?
(Using the same $() function as Šime Vidas above)