Hi there,

I have some javascript code that helps work out Gross Profit - it works fine in every other browser, but it doesn't seem to calculate in IE 8. I've had a look on Google and it might be something to do with the "getelementbyid" (i could be wrong, so apologies). Below is the javascript code (there is additional styling code etc, but i wont include that). Would anyone be able to have a look and suggest what the issue could be?

I'm not fantastic in javascript im afraid, so am struggling!

Code:
<script type="text/javascript"> 

function calcGProfit() {   
var caseprice = document.getElementById('CasePrice').value * 1;   
var unitsPerCase = document.getElementById('UnitsCase').value * 1;   
var percentProfit = document.getElementById('percGP').value / 100;   

costPrice = caseprice / unitsPerCase;   
document.getElementById('costPrice').value = costPrice.toFixed(2);        
var sellCase = costPrice / (1 - percentProfit) * unitsPerCase;   
document.getElementById('sCase').value = sellCase.toFixed(2);      
var sell$ = (sellCase / unitsPerCase);   
document.getElementById('sellPricexVAT').value = sell$.toFixed(2);   
var sell$$ = sell$ * (1 + 0.20);   
document.getElementById('sellPriceVAT').value = sell$$.toFixed(2);   
var Cmargin = sell$ - costPrice;   
document.getElementById('cashMargin').value = Cmargin.toFixed(2);  } </script> 

<script type="text/javascript"> 
function calcNewProfit() {   
var newSellPrice = document.getElementById('sellPriceNew').value * 1;      
var sellEx = newSellPrice / (1 + 0.20);   
document.getElementById('sellPricexVAT1').value = sellEx.toFixed(2);      
var equivGP = (sellEx - costPrice) / sellEx * 100;   
document.getElementById('equivGP').value = equivGP.toFixed(2);      
} 
</script>