I am trying to change the text in a div. Here is the script affected in the head:
[quote]
var insideprice = 639
var caseprice = 0
var casecolor
var osprice = 90
var Sdellprice = “1500.00”
var dellprice = 1500
var totalprice = Math.round(((1.030745814 * (insideprice + caseprice + osprice + 100)) + 2.263622527)
var savings = Math.round((dellprice – totalprice)*100)/100
var compcase
var compcolor
function ChangeDivText() {
totalprice = Math.round(((1.030745814 * 100)/100
savings = Math.round((dellprice – totalprice)
document.all[‘Dellid’].innertext = document.write(Sdellprice);
document.all[‘Sigmaid’].innertext = document.write(totalprice);
document.all[‘Savingsid’].innertext = document.write(savings);
}
This (the quote on top) is called by this function:
[quote]
function ChangeOption2(sel) {
compcase = sel.options[sel.selectedIndex].lastChild.nodeValue;
sel3 = document.getElementById(“colorselect”)
if (compcase==”X-Dreamer II”) {
document.getElementById(“color1”).lastChild.nodeValue= “Black”
document.getElementById(“color2”).lastChild.nodeValue= “Silver”
document.getElementById(“color3”).lastChild.nodeValue= “Blue”
document.getElementById(“color4”).lastChild.nodeValue= “Green”
document.getElementById(“color5”).lastChild.nodeValue= “——“
document.getElementById(“color6”).lastChild.nodeValue= “——“
document.getElementById(“color7”).lastChild.nodeValue= “——“
document.getElementById(“choosei”).src= “../Images/Cases/xdreamerII.jpg”
colorvar(sel3)
caseprice = 0
ChangeDivText()
}
……………………….(on and on)
Here is the select statement which activates the functions (the one on top)
[quote]
<div id=”Layer3″ style=”position:absolute; left:423px; top:339px; width:131px; height:27px; z-index:4; background-color: #333333; layer-background-color: #333333; border: 1px none #000000;”>
<div align=”left”>
<select name=”cases” onchange=”ChangeOption2(this)”>
<option>Choose Your Case</option>
<option>X-Dreamer II</option>
<option>X-Infinity</option>
<option>Enermax MT</option>
<option>X-Alien</option>
<option>Sonata</option>
<option>X-Super Alien</option>
</select>
</div>
</div>
and this is the div statements that are affected
[quote]
<div align=”center” id=”Dellid” style=”position:absolute; left:427px; top:272px; width:110px; height:20px; z-index:15; background-color: #333333; layer-background-color: #333333; border: 1px none #000000;” class=”style17″>
$<script type=”text/javascript”> document.write(Sdellprice) </script>
</div>
<div align=”center” id=”Sigmaid” style=”position:absolute; left:427px; top:307px; width:110px; height:19px; z-index:15; background-color: #333333; layer-background-color: #333333; border: 1px none #000000;” class=”style17″>
$<script type=”text/javascript”> document.write(savings)</script>
</div>
<div align=”center” id=”Savingsid” style=”position:absolute; left:427px; top:289px; width:110px; height:20px; z-index:15; background-color: #333333; layer-background-color: #333333; border: 1px none #000000;” class=”style17″>
$<script type=”text/javascript”> document.write(totalprice) </script>
</div>
For some reason this does not work on my page. It keeps giving an error: A runtime error has occurred. Do you wish to debug? Line: 73 Error: ‘document.all.Sigmaid” is null or not an object.
Any help would be awesome. Thanks!