Jon Henning wrote Without seeing the script it is hard to say, but most likely your issue is in the referencing of elements on the page by id, which in a framework such as DNN which uses usercontrols causes the ids to change (be prefixed) to guarantee uniqueness. See this post for more info. |
Hi thanks for the tip, but it still won't work. Here is the original code that works outside of DotNetNuke.
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide JavaScript from Java-Impaired Browsers
function calculate() {
var Stack1 = 0,Stack2 = 0,Stack3 = 0,Stack4 = 0;
Stack1 = ((document.FWform.AL1.value * document.FWform.AW1.value * document.FWform.AH1.value)/1728)/128;
Stack2 = ((document.FWform.AL2.value * document.FWform.AW2.value * document.FWform.AH2.value)/1728)/128;
Stack3 = ((document.FWform.AL3.value * document.FWform.AW3.value * document.FWform.AH3.value)/1728)/128;
Stack4 = ((document.FWform.AL4.value * document.FWform.AW4.value * document.FWform.AH4.value)/1728)/128;
document.FWform.CordsDelivered.value = Math.round((Stack1 + Stack2 + Stack3 + Stack4)*100)/100;
document.FWform.AmountShort.value = Math.round((document.FWform.AmtOrdered.value - document.FWform.CordsDelivered.value)*100)/100;
document.FWform.Overcharge.value = Math.round((document.FWform.AmountShort.value * document.FWform.CostCord.value)*100)/100;
}
// End Hiding -->
</SCRIPT>
<form name="FWform">
<ul>
<font size = "4">
<li>Take at least three measurements for each dimension to get an average.</li>
<li>Input averages in appropriate box for each stack.</li>
<li>Click the "Calculate" button to get the total number of cords and dollar amount short.</li>
<li>To file a complaint or for more information call Butte County Weights & Measures at 891-2756.</li>
</font>
</ul>
<hr>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th width="50%" height="35"><p align="center">Number of Cords Ordered:</th>
<th width="50%" height="35"><p align="center">Cost per Cord:</th>
</tr>
<tr>
<td width="50%" height="35"><p align="center"><input type="text" name="AmtOrdered" size = "10"></td>
<td width="50%" height="35"><p align="center"><input type="text" name="CostCord" size="10"></td>
</tr>
</table>
<hr>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="25%" height="35"></td>
<th width="25%" height="35" align="center">Average Width in Inches</th>
<th width="25%" height="35" align="center">Average Height in Inches</th>
<th width="25%" height="35" align="center">Average Length in Inches</th>
</tr>
<tr>
<th width="25%" height="35" align="right">Stack 1</th>
<td width="25%" height="35"><p align="center"><input type="text" name="AW1" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AH1" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AL1" size="10"></td>
</tr>
<tr>
<th width="25%" height="35" align="right">Stack 2</th>
<td width="25%" height="35"><p align="center"><input type="text" name="AW2" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AH2" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AL2" size="10"></td>
</tr>
<tr>
<th width="25%" height="35" align="right">Stack 3</th>
<td width="25%" height="35"><p align="center"><input type="text" name="AW3" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AH3" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AL3" size="10"></td>
</tr>
<tr>
<th width="25%" height="35" align="right">Stack 4</th>
<td width="25%" height="35"><p align="center"><input type="text" name="AW4" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AH4" size="10"></td>
<td width="25%" height="35"><p align="center"><input type="text" name="AL4" size="10"></td>
</tr>
</table>
<hr>
<p align="center"><input type="button" value="Calculate" name="Calculate" onClick="calculate();"></p>
<hr>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<th width="33%" height="35">Number of Cords Delivered</th>
<th width="33%" height="35">Amount Short</th>
<th width="34%" height="35">Dollar Overcharge</th>
</tr>
<tr>
<td width="33%" height="35"><p align="center"><input type="text" name="CordsDelivered" size="10"></td>
<td width="33%" height="35"><p align="center"><input type="text" name="AmountShort" size="10"></td>
<td width="34%" height="35"><p align="center"><input type="text" name="Overcharge" size="10"></td>
</tr>
</table>
</form>
I would appreciate it if anyone could help me out. Thanks.