Javascript multiplication
<p>I can't get my variables to multiply. For some strange reason, my variable values are called from input fields, but I've even tried to give them default values as below which still isn't working.</p>



<pre><code>var conMin = document.getElementById('cMin').value;
var serLev = document.getElementById('sLev').value;
var noFrames = 1800;
var noFramesTot = noFrames*24;
var coresTest = document.getElementById('coresintest').value;
var estCoreHours = 200;
var art = 20;
var coreHrs = noFrames * coresTest * art;

alert(coreHrs);
</code></pre>

<p>My alert isn't working correctly, however if I remove the <code>art</code> variable from the multiplication this then works. I've tried adding <code>parseInt()</code> to each variable only now it returns NaN. If I remove the <code>art</code> from the equation it works fine. My <code>coresTest</code> is defined in an input:</p>

<pre><code>var coresTest = document.getElementById('coresintest').value;
</code></pre>

<p>The error I get is that my function is working and not outputting anything. My entire source code for the page is.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script&gt;

function functionCalc() {

    // Variables
    var conMin = document.getElementById('cMin').value;
    var serLev = document.getElementById('sLev').value;
    var noFrames = 1800;
    var noFramesTot = noFrames*24;
    var coresTest = document.getElementById('coresintest').value;
    var estCoreHours = 200;
    var art = document.getElementById('art');
    var coreHrs = parseInt(noFrames) * parseInt(coresTest) * parseInt(art);

    // Hours Minutes Seconds variables
    var avgframerndrtme = document.getElementById('avgrndrtime').value;
    var secfunc = avgframerndrtme/3600;
    var secmin = avgframerndrtme/60;
    var hourfunc = avgframerndrtme/1;
    var conMin = document.getElementById('cMin').value;
    var art_value = art.options[art.selectedIndex].value;
    var switchart = document.getElementById('switchart').value;

    // Workout if Average render time is in minutes seconds etc...
    switch(art_value)
    {
        case "minutes":
            document.getElementById("switchart").value=secmin.toFixed(3);
            break;
        case "seconds":
            document.getElementById("switchart").value=secfunc.toFixed(3);
            break;
        case "hours":
            document.getElementById("switchart").value=hourfunc;
            break;
    }

    var total = coreHrs * serLev;

    document.getElementById("estDiv").innerHTML=total;
    document.getElementById("corehours").innerHTML=coreHrs;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Content/SLA&lt;/h1&gt;
    corehours: 
    &lt;input type='text' id='cHours' onKeyUp="functionCalc()" /&gt;&lt;br /&gt;
    content minutes:
    &lt;input type='text' id='cMin' onKeyUp="functionCalc()" /&gt;&lt;br /&gt;

    Service level: 
    &lt;select onBlur="functionCalc()" onClick="functionCalc()" id="sLev"&gt;
        &lt;option value="0.84" id="mega"&gt;Priority Mega&lt;/option&gt;
        &lt;option value="0.67" id="urgent"&gt;Priority Urgent&lt;/option&gt;
        &lt;option value="0.56" id="standard"&gt;Standard Job&lt;/option&gt;
        &lt;option value="0.28" id="scheduled"&gt;Scheduled Job&lt;/option&gt;
        &lt;option value="0.14" id="lightpass"&gt;Light Pass Job&lt;/option&gt;
    &lt;/select&gt;&lt;br /&gt;

    number of frames (Optional): 
    &lt;input type='text' id='noFrames' value="1800" /&gt;&lt;br /&gt;
    ---------------------------------------------------------------------------------
    &lt;br /&gt;

    &lt;h1&gt;render time&lt;/h1&gt;

    &lt;!-- avg frame render hours:
        &lt;input type='text' id='renHours' onKeyUp="functionCalc()" /&gt;&lt;br /&gt; --&gt;
    average render time:
    &lt;input  type='text' id='avgrndrtime' onKeyUp="functionCalc()" onBlur="functionCalc()" /&gt; 

    &lt;select onChange="functionCalc()" onBlur="functionCalc()" id="art"&gt;
        &lt;option value="hours" id="hours"&gt;Hours&lt;/option&gt;
        &lt;option value="minutes" id="mins"&gt;Minutes&lt;/option&gt;
        &lt;option value="seconds" id="secs"&gt;Seconds&lt;/option&gt;
    &lt;/select&gt;&lt;br /&gt;
    cores in test :&lt;input type='text' id='coresintest' onKeyUp="functionCalc()" /&gt;
    &lt;br /&gt;&lt;br /&gt;
    ---------------------------------------------------------------------------------&lt;br /&gt;

    &lt;h1&gt;Estimate &lt;/h1&gt;

    estimated Total : &lt;div id="estDiv"&gt;&lt;/div&gt;&lt;br&gt;
    estimated core hours : &lt;div id="corehours"&gt;&lt;/div&gt;

    &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;AVERAGE FRAME RENDER TIME  
    &lt;input type='text' id='switchart' onKeyUp="functionCalc()" /&gt;
    &lt;br /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
