How to multiply in Javascript
<p>Ok, so I'm as new as new gets to writing code with JavaScript, this is actually my first attempt and this is my issue. what I need to do with this form is multiply the input of the Qty box with the input of the Price box and auto populate the Ext box but I can only figure out how to add the totals of Qty and Price and populate that total in the Ext box. Here is the code I am using:</p>

<pre><code>function multiply1() {
    var extend1=0
    for (var i=1; i &lt;= 2; i++) {
        var id = "1_value"+i;
        extend1 = extend1 + document.getElementById(id).value*1;
    }
    document.getElementById("extend1").value = extend1;
}
function multiply2() {
    var extend2=0
    for (var i=1; i &lt;= 2; i++) {
        var id = "2_value"+i;
        extend2 = extend2 + document.getElementById(id).value*1;
    }
    document.getElementById("extend2").value = extend2;
}
 function multiply3() {
    var extend3=0
    for (var i=1; i &lt;= 2; i++) {
        var id = "3_value"+i;
        extend3 = extend3 + document.getElementById(id).value*1;
    }
    document.getElementById("extend3").value = extend3;
}
function multiply4() {
    var extend4=0
    for (var i=1; i &lt;= 2; i++) {
        var id = "4_value"+i;
        extend4 = extend4 + document.getElementById(id).value*1;
    }
    document.getElementById("extend4").value = extend4;
}
 function multiply5() {
    var extend5=0
    for (var i=1; i &lt;= 2; i++) {
        var id = "5_value"+i;
        extend5 = extend5 + document.getElementById(id).value*1;
    }
    document.getElementById("extend5").value = extend5;
}
</code></pre>

<p>Also if you input a total in the qty box it will populate the ext box but should also populate to totals of the ext boxes in the Material Total box which obviously isn't happening the script works to total the ext boxes up and populate the material totals box as u can see by entering a total into any of the ext boxes and it will populate or total into the material total box.  </p>

<p>Ok so first I need to multiply the Qty and Price boxes and secondly I need to figure out why this script isn't getting the value from the ext boxes after they are input from the Qty and Price script</p>

<pre><code>function summate() {
    var mattotal=0
    for (var i=1; i &lt;= 5; i++) {
        var id = "extend"+i;
        mattotal = mattotal + document.getElementById(id).value*1;
    }
    document.getElementById("mattotal").value = mattotal;
}
</code></pre>

<p>Thanks for your help!</p>
