title: Calculating a total from quantity of a product
body: <p>I am building a website for a restaurant and want users to be able to choose how much food they would like to order.  I am very new to JavaScript and am going to school for it right now but in the meantime I need some help with this question.</p>
  
  <p>I have it so far that it will calculate a total based on the quantity and the price, the problem that I am having is that the customer can change the price!  How can I change this and not change my code too much since it has taken me forever to get it to work.</p>
  
  <p>Here is my HTML:</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;Bruschetta con Crema di Agliotoa&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" value="" name="QTY" id="QTY" onKeyUp="multiply()"/&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="PPRICE" id="PPRICE" value="8" /&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="TOTAL" id="TOTAL" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>And my simple script:</p>
  
  <pre><code>function multiply()
  {
      a = Number(document.getElementById('QTY').value);
      b = Number(document.getElementById('PPRICE').value);
      c = a * b;
  
      document.getElementById('TOTAL').value = c;
  }
  </code></pre>