
September 12th, 2012, 05:18 PM
|
|
Contributing User
|
|
Join Date: May 2012
Posts: 52
Time spent in forums: 10 h 19 m 15 sec
Reputation Power: 1
|
|
|
Beginners Question on printing a value calculated in script to html table.
Essentially I have table which I want to have it's values pulled from answers to calculations that are found in my script instead of how I have them typed in now ( i didnt fill them all in as this is just to test). Is this simple?
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calculatortest</title>
<script>
var period=new Array();
period [0] = 6;
pariod [1] = 12;
period [2] = 18;
period [3] = 24;
var annualrate= new Array();
annualrate [0] = .04;
annualrate [1] = .05;
annualrate [2] = .06;
var period = 10000;
function totalinterest()
{
var totalinterest = principle * annualrate * period;
return totalinterest;
}
function totalloancost()
{
var totalloancost = principle + total interest;
}
</script>
</head>
<body>
<table border="1" bordercolor="#FFCC00" style="background-color:#FFFFCC" width="50%" cellpadding="3" cellspacing="3">
<tr>
<td> Rate (annual) 4% 10200 <br>Period (months)</td>
<td>5%</td>
<td>6%</td>
</tr>
<tr>
<td> 10400</td>
<td></td>
<td>Table Cell</td>
</tr>
<tr>
<td>10600</td>
<td>Table Cell</td>
<td>Table Cell</td>
</tr>
<tr>
<td>Table Cell</td>
<td>Table Cell</td>
<td>Table Cell</td>
</tr>
</table>
</body>
</html>
|