title: My codes show nothing after clicking 'calculate' in html
body: <p>Furthermore,I also realize that the values typed before clicking 'calculate' are disappear also.Until now I still cannot find the errors because I think my formula in calculating mortgage loan is correct.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt;
      &lt;script src="cal_mortgage.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form&gt;
          &lt;table&gt;
          &lt;h2&gt;mortgage calculator:&lt;/h2&gt;
          &lt;tr&gt;&lt;td&gt;principal&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="principal"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;interest %&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="interest"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;term (year)&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="term"/&gt;&lt;/td&gt;&lt;/tr&gt;&lt;p&gt;&lt;/p&gt;
          &lt;tr&gt;&lt;td&gt;&lt;input type="submit" value="calculate" onclick="cal_mortgage()"/&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;monthly payment&lt;/td&gt;&lt;td&gt;&lt;input type="text" id="monthly_pay"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>JavaScript code:</p>
  
  <pre><code>function cal_mortgage()
  
  {
      var PR = form.principal.value; /*present value of the mortgage loan*/             
      var IN = (form.interest.value / 100) / 12; /*interest rate of the mortgage loan*/  
      var PE = form.term.value * 12; /*number of periods of the mortgage loan*/  
  
      var PAY = (PR * IN) / (1 - Math.pow(1 + IN, -PE)); /*regular payment to apply to the mortgage loan*/
  
      form.monthly_pay.value = PAY; 
  }
  </code></pre>