| Hi there fuso-ga!
The code you saw in those two boxes are merely button links to the
Mortgage Calculator on the kbapps site. I launched the calculator by
clicking on the "Mortgage Calculator" button and got a popup window
with the correct form in it. I then proceeded to View Source and saved
it as my own file, mort_calc.htm. When I tried opening this file in my
browser, I got redirected to the kbapps site. Looking at the code, I
noticed there is some Javascript that causes the redirection if not
viewed off the kbapps site. I have taken out this code, and modified
it to say "Alicia's Mortgage Calculator". It is not very long, and I
have pasted it here :
+-----------------------------------------------------------------------------+
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<title>Alicia's Mortgage Calculator</title>
<style type="text/css">
  <!--
A:LINK    { COLOR :#FFFF00; TEXT-DECORATION:NONE;}
A:ACTIVE  { COLOR :#00FF00; TEXT-DECORATION:NONE;}
A:VISITED { COLOR :#FFFF00; TEXT-DECORATION:NONE;} 
A:HOVER   { COLOR :#80FF80; TEXT-DECORATION:UNDERLINE;}
  //-->
</style>
<script
LANGUAGE="JavaScript">
<!-- hide javascript
function calculate(){
	var PV = Number(document.forms[0].PV.value);
	var N = Number(document.forms[0].N.value);
	var i = Number(document.forms[0].i.value);
	var time = Number(document.forms[0].time.selectedIndex);
	var mPMT = 0;
	var tPMT = 0;
	var tINT = 0;
    if (i >= 1.0) { i = i / 100;}
	i = i / 12;
	
	if ( time == 1 ){ N = N;}
	if ( time == 0 ){ N = N * 12;}
	var x = 1 + i;
   mPMT = ( PV * Math.pow(x,N) ) / ( ( ( Math.pow(x,N) - 1 ) / i ) );
   tPMT = mPMT * N;
   tINT = tPMT - PV;
   document.forms[0].mPMT.value = Math.round( 100 * mPMT)/ 100;
   document.forms[0].tPMT.value = Math.round( 100 * tPMT)/ 100;
   document.forms[0].tINT.value = Math.round( 100 * tINT)/ 100;
}
// done hiding -->
</script>
<!-- end function -->
</head>
<body bgcolor="#FFFFFF" text="#000040" link="#FFFF00" vlink="#FFFF00"
alink="#00FF00">
<font size="5">Alicia's Mortgage Calculator<div align="left">
<table border="0" bgcolor="#FFFFFF" cellspacing="0" cellpadding="0"
width="250"
height="250">
  <tr>
    <td><form>
      <div align="center"><center><table border="0" cellpadding="3"
cellspacing="0">
        <tr>
          </font><td align="left" valign="middle"><div
align="left"><p>Loan Amount </td>
          <td><input name="PV" type="text" size="10"></td>
        </tr>
        <tr>
          <td>Interest (Annual)</td>
          <td><input name="i" type="text" size="10" value="8.00"></td>
        </tr>
        <tr>
          <td>Number of <select name="time" size="1">
            <option value="years">years</option>
            <option value="months">months</option>
          </select></td>
          <td><input name="N" type="text" value="40" size="3"></td>
        </tr>
        <tr>
          <td></td>
          <td><input TYPE="button" VALUE="Calculate"
onClick="calculate()"></td>
        </tr>
        <tr>
          <td>Monthly Payments</td>
          <td><input name="mPMT" type="text" size="10"></td>
        </tr>
        <tr>
          <td>Total of Payments</td>
          <td><input name="tPMT" type="text" size="10"></td>
        </tr>
        <tr>
          <td>Total Interest Paid</td>
          <td><input name="tINT" type="text" size="10"></td>
        </tr>
      </table>
      </center></div>
    </form>
    </td>
  </tr>
</table>
</div>
</body>
</html>
+-----------------------------------------------------------------------------+
Go ahead and save the above code as a .htm file, and try opening it.
Have fun learning! Let me know if you need any further help.
Regards,
kyrie26-ga |