Simple Calculation?

I’m trying to make a little javascript program that can do the following:

Input Square foot of wallpaper in container

Input Surface Area of Wall + Input 10% of Surface Area of Wall = Out of Total Square Feet

Output: Total Number of Containers needed to meet Total Square Feet

Below I have the following code. It worked previously, but after a recent change I can’t seem to get it to caculate. Can anyone offer another set of eyes?

<table cellpadding=“0” id=“section0” >
<tr valign=“top”>
<td style=“padding-left:20px;padding-top:10px;” colspan=“2”>
<a class=“content”>First enter the square footage per box of the product you are ordering.<br /><br />
There is <input type=“text” id=“prod1Coverage” size=“4” class=“content” onchange=“javascript:jsCalcSQFT(‘prod’,1);”> S/Ft. per box.
<br /><br />Then, enter the area you wish to cover below to calculate quantity needed.  </a>
</td>
</tr>
<tr valign=“top”>
<td>
<table cellpadding=“0” id=“wallsqft”>
<tr valign=“top” id=“rmQuestion”>
<td style=“padding-left:20px;” colspan=“2”><a class=“content”>In how many wall will you be using for wallpaper? </a>
<select class=“content” name=“numRooms” onChange=“javascript:jsCreateWalls(this.value);this.value=‘0’;”>
<option selected value=“0”></option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
</select><br /><br />
</td>
</tr>
<script language=“JavaScript” type=“text/javascript”>
//<!–
for (var i=1; i <= 9; i++) {
document.write(‘<tr valign=“top” style=“display:none;” id="wall’ + i + ‘">’);
document.write(‘<td style=“padding-left:20px;”><a class=“content”>Wall ‘+ i + ‘: </a></td>’);
document.write(’<td><input type=text id="r’+i+‘Length" size=“2” value=“” onChange=“javascript:jsAdvCalcProduct(\‘prod\’);jsCalcSQFT(\‘prod\’,1);”><a class=“content”> by </a>’);
document.write(‘<input type=text id="r’+i+‘Width" size=“2” value=“” onChange=“javascript:jsAdvCalcProduct(\‘prod\’);jsCalcSQFT(\‘prod\’,1);”> <a class=“content”> Feet</a></td>’);
document.write(‘</tr>’);
}
//–>
</script>
</table>
</td>
</tr>
<tr valign=“top”>
<td style=“padding-left:20px;padding-top:20px;” colspan=“2”><a class=“content”>
Area: <input type=text id=“prodArea1” size=“3” maxlength=“5” onchange=“javascript:jsCalcSQFT(‘prod’,1);”>
S/FT + <input type=text id=“prodWaste1” size=“1” maxlength=“2” value=“10” onchange=“javascript:jsCalcSQFT(‘prod’,1);”>
% Waste = <input type=text id=“prodTArea1” size=“5” readonly style=“border:0;text-align:right;background-color:#eee;”> S/F
= <input type=text id=“prodQty1” size=“1” readonly style=“border:0;text-align:right;background-color:#eee;”> Box(es)&nbsp 
</a>
</td>
</tr>
<tr valign=“top”>
<td class=“maincontent” colspan=“2”>
<a class=“content” href=“javascript:jsToggleSection(‘wallsqft’)” style=“text-decoration:none;”><span class=“headline”><u>Calculate Square Footage</u></span></a><a class=“content”> based on the size of wall(s).</a>
</td>
</tr>
</table>

I’m sorry. I imagine that would be helpful:

//Calculators
function jsAdvCalcProduct(prefix)
{
var totalArea = 0;
for (var i=1; i <= 9; i++)
{
intWidth = jsCleanNum(document.getElementById(‘r’+i+‘Width’).value);
document.getElementById(‘r’+i+‘Width’).value = intWidth;
intLength = jsCleanNum(document.getElementById(‘r’+i+‘Length’).value);
document.getElementById(‘r’+i+‘Length’).value = intLength;
if (jsCheckVisible(‘wall’+i))
{
area = intWidth * intLength;
totalArea = totalArea + area;
}
}
totalArea = doRound(totalArea,2);
document.getElementById(prefix+‘Area1’).value = totalArea;
}

function jsCalcSqFeet(area,waste)
{
area = jsCleanNum(area);
waste = jsCleanNum(waste);
area = area * (1+(waste/100));
area = doRound(area,2);
return area;
}
function jsCalcSQFT(prefix,num)
{
var area = parseFloat(jsCleanNum(document.getElementById(prefix+‘Area’+num).value));
document.getElementById(prefix+‘Area’+num).value = doRound(area,2);
var waste = parseFloat(jsCleanNum(document.getElementById(prefix+‘Waste’+num).value));
document.getElementById(prefix+‘Waste’+num).value = doRound(waste,0);
var coverage = parseFloat(document.getElementById(prefix+num+‘Coverage’).value);
var tarea = jsCalcSqFeet(area,waste);
document.getElementById(prefix+‘TArea’+num).value = tarea;
var quantity = jsCalcQuantity(tarea,coverage);
document.getElementById(prefix+‘Qty’+num).value = quantity;
}

function jsCreatewalls(entry)
{
for (var i=entry; i <= 9; i++)
{
jsHideElement(‘wall’+i);
}
for (var i=1; i <= entry; i++)
{
jsShowElement(‘wall’+i);
}
}

function jsToggleSection(obj)
{
jsToggleElement(obj);

	if (obj == 'advCalc')
	{
		jsShowElement('rmQuestion');
		for (var i=1; i &lt;= 9; i++)
		{  
			jsHideElement('wall'+i);
		}
	}
}

That is the entire page’s code.

Do you know which functions it says is missing?

The main one is jsCalcSQFT but there’s also jsCreateWalls, jsAdvCalcProduct and jsToggleSection

Can you provide a sample page so that we can investigate further? When working with the above code there are errors about certain functions not existing.

The change that occured was adding the ability to caculate each room up to 9 rooms
and toggle to display the amount of rooms you wish to use: href=“javascript:jsToggleSection(‘wallsqft’)”

Really? So where are these lines (at the very least)?

<html>
<head>
</head>
<body>
<!-- TABLE code you provided would be here -->
</body>
</html>

Would you mind providing some information about the recent change that occurred?