Note that there are some explanatory texts on larger screens.

plurals
  1. POUse arrays to add up values based on the title or the alt attribute
    primarykey
    data
    text
    <p>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.</p> <p>So now per product there is a Total Price, Total Duration and Total Number of Dives as seen here. </p> <pre><code>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; </code></pre> <p>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...</p> <p>Not sure how but a few ideas would be an array that added up only fields with a specific alt tag or title tag. </p> <p>Anyone got any ideas.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload