Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <script language ="javascript">
- 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;
- }
- </script>
- <form>
- Product Name: <input type="text" id="name" name="productName">
- <br>
- Product Price: <input type="text" id="price" name="productPrice">
- <br>
- Product Qty: <input type="text" id="qty" name="productQty" type="text" id="total" name="producttotal"
- onChange="Calculate()">
- <br>
- Total: <input type="text" id="total" name="producttotal">
- <hr>
- Product Name: <input type="text" id="name2" name="productName">
- <br>
- Product Price: <input type="text" id="price2" name="productPrice">
- <br>
- Product Qty: <input type="text" id="qty2" name="productQty" type="text" id="total" name="producttotal"
- onChange="Calculate()">
- <br>
- Total: <input type="text" id="total2" name="producttotal">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement