title: how to dynamically calculate value in the text box
body: <p>i have a invoice where i have to calculate some value in the textbox using jquery.</p>
  
  <p>I don't know much about Jquery. Please help me to solve this problem. </p>
  
  <p>In my invoice there is quantity textbox, </p>
  
  <blockquote>
    <p>if users enters the quantity then dynamically it should  show the
    calculated price i.e <code>(total_subPrice= unit_price * quantity)</code> in
    another textbox called "price".</p>
  </blockquote>
  
  <p>And again the total sum of all the price should be visible in the button as a Total.</p>
  
  <p>please check my below html code and run it in browser then you will understand my problem exactly.</p>
  
  <pre><code>             &lt;html&gt;
          &lt;body&gt;
          &lt;form name="invoice form" action="saveToDatabase.java"&gt;
          &lt;table border="1" height="30%" width="30%"&gt;
          &lt;tr&gt;
          &lt;td align="center" colspan="5"&gt;Customer Invoice&lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td width="5%" bgcolor="#CCCCCC"&gt;Sn.no.&lt;/td&gt;
              &lt;td width="25%" bgcolor="#CCCCCC"&gt;Item&lt;/td&gt;
              &lt;td width="25%" bgcolor="#CCCCCC"&gt;Unit Price(In $)&lt;/td&gt;
              &lt;td width="20%" bgcolor="#CCCCCC"&gt;Quantity&lt;/td&gt;
              &lt;td width="25%" bgcolor="#CCCCCC"&gt;Line Total&lt;br/&gt;(Price * Qnty)&lt;/td&gt;  
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td width="5%"&gt;1&lt;/td&gt;
              &lt;td width="25%"&gt;Iphone 5S&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" value="400" name="unitprice1" size="4" disabled&gt;&lt;/td&gt;
              &lt;td width="20%"&gt;&lt;input type="text" name="quantity1" value="2" size="2"/&gt;&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" name="price1" value="400" size="4"/&gt;&lt;/td&gt;  
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td width="5%"&gt;2&lt;/td&gt;
              &lt;td width="25%"&gt;Ipad 2&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" value="700" name="unitprice2" size="4" disabled&gt;&lt;/td&gt;
              &lt;td width="20%"&gt;&lt;input type="text" name="quantity2" value="1" size="2"/&gt;&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" name="price2=" value="700" size="4"/&gt;&lt;/td&gt;  
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td width="5%"&gt;1&lt;/td&gt;
              &lt;td width="25%"&gt;mp3&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" value="50" name="unitprice1" size="4" disabled&gt;&lt;/td&gt;
              &lt;td width="20%"&gt;&lt;input type="text" name="quantity1" value="3" size="2"/&gt;&lt;/td&gt;
              &lt;td width="25%"&gt;&lt;input type="text" name="price1" value="150" size="4"/&gt;&lt;/td&gt;  
          &lt;/tr&gt;
          &lt;tr&gt;
          &lt;td align="right" colspan="5"&gt;Total&lt;input type="text" name="subtotal" value="1250" size="12" disabled/&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
          &lt;/form&gt;&lt;/body&gt;
          &lt;/html&gt;
  </code></pre>