...

View Full Version : Calulating Square Feet?



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

Example:

12 Feet Wide * 20 Feet Length = 240 square feet

how would i script this?

sad69
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.

Sadiq.

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



<html>
<head>
<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.');
}

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


Hope That Helps,
Basscyst



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum