Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <body>
  2. <script language ="javascript">
  3. function Calculate(){
  4.  
  5. var pricee = document.getElementById('price').value;
  6. var qtyy = document.getElementById('qty').value;
  7. var sum = pricee * qtyy;
  8. document.getElementById('total').value = sum;
  9.  
  10. var newprice = document.getElementById('price2').value;
  11. var newqty = document.getElementById('qty2').value;
  12. var sum2 = newprice * newqty;
  13. document.getElementById('total2').value = sum2;
  14. }
  15. </script>
  16.  
  17.  
  18. <form>
  19. Product Name: <input type="text" id="name" name="productName">
  20. <br>
  21. Product Price: <input type="text" id="price" name="productPrice">
  22. <br>
  23. Product Qty: <input type="text" id="qty" name="productQty" type="text" id="total" name="producttotal"
  24. onChange="Calculate()">
  25. <br>
  26. Total: <input type="text" id="total" name="producttotal">
  27.  
  28. <hr>
  29.  
  30. Product Name: <input type="text" id="name2" name="productName">
  31. <br>
  32. Product Price: <input type="text" id="price2" name="productPrice">
  33. <br>
  34. Product Qty: <input type="text" id="qty2" name="productQty" type="text" id="total" name="producttotal"
  35. onChange="Calculate()">
  36. <br>
  37. Total: <input type="text" id="total2" name="producttotal">
  38.  
  39.  
  40.  
  41. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement