Menu
I have created a Javascript calculator that figures cubic yards used for volume calculations. I have checked and double checked but am sure I am missing something simple (as this entire project should be simple to begin with) but to my dispair, the Calculate button doesn’t do the calculations. Could someone take the 5 minutes needed please and direct me as to why this isn’t working?
Here is the page:
[url]http://www.nexuscore.net/mjf/volumecalc.html
THANKS!
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Cubic Volume Calculations</title>
<SCRIPT LANGUAGE="JavaScript">
function calculate(isForm){
WidthFt = parseFloat(isForm.WidthFt.value)
WidthIn = parseFloat(isForm.WidthIn.value)
HeightFt = parseFloat(isForm.HeightFt.value)
HeightIn = parseFloat(isForm.HeightIn.value)
DepthIn = parseFloat(isForm.DepthIn.value)
ry=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/46656).toFixed(4);
rf=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/27).toFixed(4)
isForm.ResultsYds.value=ry;
isForm.ResultsFeet.value=rf;
isForm.WidthFt.focus();
}
</SCRIPT>
</head>
<body bgcolor="#ffffff">
</body>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Cubic Volume Calculations</title>
<SCRIPT LANGUAGE="JavaScript">
function calculate(){
WidthFt = parseFloat(document.forms.yds3.WidthFt.value)
WidthIn = parseFloat(document.forms.yds3.WidthIn.value)
HeightFt = parseFloat(document.forms.yds3.HeightFt.value)
HeightIn = parseFloat(document.forms.yds3.HeightIn.value)
DepthIn = parseFloat(document.forms.yds3.DepthIn.value)
ry=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/46656).toFixed(4);
rf=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/27).toFixed(4)
document.forms.yds3.ResultsYds.value=ry;
document.forms.yds3.ResultsFeet.value=rf;
document.forms.yds3.WidthFt.focus();
}
</SCRIPT>
</head>
<body bgcolor="#ffffff">
</body>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Cubic Volume Calculations</title>
<SCRIPT LANGUAGE="JavaScript">
function calculate(){
alert('Hello');
WidthFt = parseFloat(document.forms[0].WidthFt.value)
WidthIn = parseFloat(document.forms[0].WidthIn.value)
HeightFt = parseFloat(document.forms[0].HeightFt.value)
HeightIn = parseFloat(document.forms[0].HeightIn.value)
DepthIn = parseFloat(document.forms[0].DepthIn.value)
ry=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/46656).toFixed(4);
rf=((WidthFt*12+WidthIn)*(HeightFt*12+HeightIn)*DepthIn/27).toFixed(4)
document.forms[0].ResultsYds.value=ry;
document.forms[0].ResultsFeet.value=rf;
document.forms[0].WidthFt.focus();
}
</SCRIPT>
</head>
<body bgcolor="#ffffff">
</body>
0.1.9 — BETA 5.17