View Full Version : Calulating Square Feet?

03-21-2004, 04:42 PM
Trying to calulate square feet?


12 Feet Wide * 20 Feet Length = 240 square feet

how would i script this?

03-22-2004, 06:38 PM
Just like that!

The real questions you should be asking yourself is:
-Where are you getting the width and length from?
-Where do you plan on storing the result (square footage)?

Figure that out and maybe we can further help you.


03-22-2004, 10:46 PM
Somthing like this?

<script type="text/javascript">

function calcSqFeet()
var x=document.getElementById('wdt').value;
var y=document.getElementById('hgt').value;
var sqfeet=x*y;
alert('The area is '+x+' X '+y+'. Which is '+sqfeet+' sqft.');

<form id="f1" onsubmit="calcSqFeet()">
Width:<input type="text" id="wdt">
Height:<input type="text" id="hgt">
<input type="submit" value="Calculate">

Hope That Helps,

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum