title: How to calculate sub_total and total_price inputs on onkepress event + JS
body: <p>How to multiply the <code>Qty</code> textbox with <code>Price</code> textbox then print the output on <code>Subtotal</code> textbox? And then add the grand total of <code>Subtotal</code> textboxes and print the sum on <code>Total Price</code> textbox with keypress event.</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;
      Qty&lt;input type="text" name="item_qty0" id="item_qty0" class="item_qty valid" onkeypress="return calProduct(this);" value="1" autocomplete="off" /&gt;
      Price&lt;input type="text" name="item_price0" id="item_price0" class="item_price valid" onkeypress="return calProduct(this);" value="0" autocomplete="off" /&gt;
      Subtotal&lt;input type="text" name="item_subtotal0" id="item_subtotal0" class="item_subtotal" disabled="" /&gt;
  &lt;/li&gt;
  &lt;li&gt;
       Qty&lt;input type="text" name="item_qty1" id="item_qty1" class="item_qty valid" onkeypress="return calProduct(this);" value="1" autocomplete="off" /&gt;
      Price&lt;input type="text" name="item_price1" id="item_price1" class="item_price valid" onkeypress="return calProduct(this);" value="0" autocomplete="off" /&gt;
      Subtotal&lt;input type="text" name="item_subtotal1" id="item_subtotal1" class="item_subtotal" disabled="" /&gt;           
  &lt;/li&gt;
  &lt;/ul&gt;
      &lt;hr /&gt;
  &lt;p style="text-align:right;"&gt;
      Total Price&lt;input name="total_price" maxlength="15" type="text" id="totalPrice" /&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p><a href="http://jsfiddle.net/isaacrajaei/LVFgH/8/" rel="nofollow">Demo</a></p>