Calculations between input boxes
<p>I'm writing a script where I need to get the total of two calculations and determine the total quote. The problem is I cannot get them to work when it comes to add them together. Bear in mind I'm a newbie and the code might no be fully optimized but I'm sure you will get the point. Any improvements on the code are more than welcome. </p>

<pre><code>&lt;div&gt;
        &lt;fieldset&gt;
            &lt;legend&gt;Printing&lt;/legend&gt;
        Number of color pages:&lt;input type="text" id="color" placeholder="Color Pages" onchange="printing();" onchange = "binding();" /&gt;
        &lt;input type="text" id="colorprice" readonly="readonly" /&gt;&lt;br /&gt;
        Number of black and white pages:&lt;input type="text" id="black" placeholder="Black and White Pages" onchange="printing();" onchange = "binding();" /&gt;
        &lt;input type="text" id="blackprice" readonly="readyonly" /&gt;&lt;br /&gt;
        Total Pages:&lt;input type="text" id="pages_total" readonly="readonly" /&gt; &lt;input type="text" id="sum_pages" readonly="readonly" onchange = "suming();"/&gt;
        &lt;/fieldset&gt;

    &lt;/div&gt;

&lt;div&gt;
        &lt;fieldset&gt;
            &lt;legend&gt;Binding&lt;/legend&gt;
            Number of Hardbooks: &lt;input type="text" id="books" placeholder="Number of Hardbooks" onchange="binding();" /&gt;
            &lt;input type="text" id="books_price" readonly="readonly" /&gt;&lt;br /&gt;
            Number of Softbacks: &lt;input type="text" id="softback" placeholder="Number of Softbacks" onchange="binding();" /&gt;
            &lt;input type="text" id="soft_price" readonly="readonly" /&gt;&lt;br /&gt;
            Total Bindings: &lt;input type="text" id="total_bindings" readonly="readonly" /&gt;&lt;input type "text" id="total_price" readonly="readonly" /&gt;
        &lt;/fieldset&gt;
    &lt;/div&gt;

&lt;p&gt;Final quote:&lt;input type="text" readonly="readonly" id="quote" /&gt;&lt;/p&gt;

function printing() {
                var blackPrice;
                var colorPrice;
                var printBlack = new Array(0.10, 0.08, 0.06, 0.05);
                var printColor = new Array(0.40, 0.35, 0.30, 0.25);


                var colorPages = parseInt(document.getElementById("color").value);
                var blackPages = parseInt(document.getElementById("black").value);

                if (colorPages &lt; 11) {
                colorPrice = colorPages * printColor[0];
                    }
                else if (colorPages &gt;= 11 &amp;&amp; colorPages &lt; 51){
                colorPrice = colorPages * printColor[1];
                    }
                else if (colorPages &gt;= 51 &amp;&amp; colorPages &lt; 101){
                    colorPrice = colorPages * printColor[2];
                    }
                else {
                    colorPrice = colorPages * printColor[3];
                    }



                if (blackPages &lt; 11) {
                blackPrice = blackPages * printBlack[0];
                    }
                else if (blackPages &gt;= 11 &amp;&amp; colorPages &lt; 51){
                blackPrice = blackPages * printBlack[1];
                    }
                else if (blackPages &gt;= 51 &amp;&amp; colorPages &lt; 101){
                blackPrice = blackPages * printBlack[2];
                    }
                else {
                blackPrice = blackPages * printBlack[3];
                    }

                var pagesTotal = colorPages + blackPages;

                var printSum = blackPrice + colorPrice;


                document.getElementById("colorprice").value = "$" + colorPrice.toFixed(2);
                document.getElementById("blackprice").value = "$" + blackPrice.toFixed(2);
                document.getElementById("sum_pages").value = "$" + printSum.toFixed(2);
                document.getElementById("pages_total").value = pagesTotal;

                return printSum;

}



function binding(){

var softbackPrice;
var hardbookPrice;
var hardBooks = new Array(37.50, 23.50);
var softBacks = new Array(3.75, 4.00, 4.25, 4.50, 4.75, 5.00, 5.25);
var noBooks = parseInt(document.getElementById("books").value); 
var noSoftBacks = parseInt(document.getElementById("softback").value); 
var colorPages = parseInt(document.getElementById("color").value);
var blackPages = parseInt(document.getElementById("black").value);
var totalPages = colorPages + blackPages;

if (noBooks == 1) { 
    hardbookPrice = hardBooks[0];
    }
else {
        hardbookPrice = (hardBooks[1] * (noBooks - 1)) + hardBooks[0];
    }

if (totalPages &lt;= 50) {
    softbackPrice = softBacks[0] * noSoftBacks;
    }
else if (totalPages &gt; 50 &amp;&amp; totalPages &lt;= 100) {
    softbackPrice = softBacks[1] * noSoftBacks;
    }
else if (totalPages &gt; 100 &amp;&amp; totalPages &lt;= 150) {
    softbackPrice = softBacks[1] * noSoftBacks;
    }
else if (totalPages &gt; 150 &amp;&amp; totalPages &lt;=200) {
    softbackPrice = softBacks[2] * noSoftBacks;
    }
else if (totalPages &gt; 200 &amp;&amp; totalPages &lt;= 250) {
    softbackPrice = softBacks[3] * noSoftBacks;
    }
else if (totalPages &gt; 250 &amp;&amp; totalPages &lt;= 300) {
    softbackPrice = softBacks[4] * noSoftBacks;
    }
else if (totalPages &gt; 300 &amp;&amp; totalPages &lt;= 350) {
    softbackPrice = softBacks[5] * noSoftBacks;
    }
else {
    softbackPrice = softBacks[6] * noSoftBacks;
}   



var totalPrice = softbackPrice + hardbookPrice;
var bindingsTotal = noSoftBacks + noBooks;


document.getElementById("books_price").value = "$" + hardbookPrice.toFixed(2);
document.getElementById("soft_price").value = "$" + softbackPrice.toFixed(2);
document.getElementById("total_bindings").value = bindingsTotal;
document.getElementById("total_price").value = "$" + totalPrice.toFixed(2);


return totalPrice;

}

function totalSum() {
var totalPrinting = printing();
var totalBinding = binding();
var subtotal = totalPrinting + totalBinding;
document.getElementIdBy("quote").value = subtotal;
}
</code></pre>
