title: Did not get total from second input fields?
body: <p>I am new to javascript writing some code by myself using DOM technique. My First block of code work properly and it gives me sum to first two input fields but i didn't get sum when i entered values of 2nd block of code. here is my code</p>
  
  <pre><code>&lt;body&gt;
          &lt;script language ="javascript"&gt;
                  function Calculate(){
  
                      var pricee = document.getElementById('price').value;
                      var qtyy = document.getElementById('qty').value;
                      var sum = pricee * qtyy;
                      document.getElementById('total').value = sum;
  
                      var newprice = document.getElementById('price2').value;
                      var newqty = document.getElementById('qty2').value;
                      var sum2 = newprice * newqty;
                      document.getElementById('total2').value = sum2;
                  }
              &lt;/script&gt;
  
  
      &lt;form&gt;
         Product Name: &lt;input type="text" id="name" name="productName"&gt;
         &lt;br&gt;
         Product Price: &lt;input type="text" id="price" name="productPrice"&gt;
         &lt;br&gt;
         Product Qty: &lt;input type="text" id="qty" name="productQty" type="text" id="total" name="producttotal"
         onChange="Calculate()"&gt;
         &lt;br&gt;
         Total: &lt;input type="text" id="total" name="producttotal"&gt;
  
         &lt;hr&gt;
  
         Product Name: &lt;input type="text" id="name2" name="productName"&gt;
         &lt;br&gt;
         Product Price: &lt;input type="text" id="price2" name="productPrice"&gt;
         &lt;br&gt;
         Product Qty: &lt;input type="text" id="qty2" name="productQty" type="text" id="total" name="producttotal"
         onChange="Calculate()"&gt;
         &lt;br&gt;
         Total: &lt;input type="text" id="total2" name="producttotal"&gt;
  
  
  
      &lt;/form&gt;
  </code></pre>