title: Homework Sales calculator
body: <p>Yesterday I submitted this problem, got terrific responses but my code still didn't work. I modified my code based on another student's code that works, but my code still won't calculate but it validates in javascript. Any suggestions. This homework is due TONIGHT! </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4       /loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Price Calculator&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      function fixOrder() {
          const TAX = 0.975;
          var numPrice;
          var total;
          var tax;
  
          numPrice = parseFloat(document.getElementById("cost").value, 10);
          tax      = parseFloat(document.getElementById("tax").value, 10);
          total    = parseFloat(document.getElementById("total").value, 10);
          numPrice = numPrice * TAX;
          total    = numPrice;
          total    = document.getElementById("total").value = "$" + total.toFixed(2);
  
          if (isNaN(numPrice)) {
              alert("Sorry,you must enter a numeric value to place order");
              numPrice = 0;
          }
      }
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body bgcolor="#00f3F1"&gt;
  
      &lt;h1 align="left"&gt;Price Calculator&lt;/h1&gt;
  
      &lt;form name="form" id="form"&gt;
         &lt;p&gt;Price: &lt;input type="text" id="cost" name="cost" value="" onchange=
         "fixOrder" /&gt;&lt;/p&gt;
  
         &lt;p&gt;Tax: &amp;nbsp; &lt;input type="text" id="tax" name="tax" value="" onchange=
         "fixOrder" /&gt;&lt;/p&gt;
  
         &lt;p&gt;Total: &lt;input type="text" id="total" name="total" value="" disabled=
         "disabled" /&gt;&lt;/p&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>