Trouble with Variable value in function
<p>I have the following script where a variable gets its value from an input field, however when I run my function its not working, returns nothing. Im new to JS so im unsure if it needs to be part of a function *even though Ive tried this with no luck) or what...</p>

<pre><code>/////////////////////////////////////////////////////////////////////

// Variables

// Content/SLA
var ContentMinutes = '';
var ContentMinutesSelector; // Switch Case
var ServiceLevel = 5;
var NoOfFrames = 2;

// Render Time (Hairier the Better)
var AvgFrameRenderTime = '';
var AvgFrameRenderTimeSelector = 10; // Switch Case
var CoresInTest = document.getElementById('CoresInTest').value;

// Other
var EstimatedCoreHours = NoOfFrames * CoresInTest * AvgFrameRenderTimeSelector;

// Cost Estimate
var CostEstimate = ServiceLevel * EstimatedCoreHours;


/////////////////////////////////////////////////////////////////////

//  Functions

function CalculateEstimate() {  
// Estimate Cost
parseInt(document.getElementById("PriceEstimate").innerHTML=CostEstimate.toFixed(2));

// Estimate Core Hours
parseInt(document.getElementById("EstimatedCoreHours").innerHTML=EstimatedCoreHours.toFixed(    2));
}
</code></pre>

<p>my PriceEstimate and EstimatedCoreHours fields are both just empty divs, <code>&lt;div id="EstimatedCoreHours"&gt;&lt;/div&gt;</code>, My calculations work if i define a value for the variable as opposed to <code>document.getElementById</code> so I believe I must need to run a function or something to update all the vartiables?</p>

<p>But if I set...</p>

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

<p>to</p>

<pre><code>var CoresInTest = 10;
</code></pre>

<p>Then it works fine...</p>

<p>Its not actually my return, the problem is my variables arent calling, IF i define them with a number then it works.</p>
