Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <script type="text/javascript">
  5. function calc(a,b, out)
  6. {
  7. document.getElementById(out).value = a*b;
  8.  
  9. }
  10. </script>
  11. </head>
  12. <body>
  13. <table>
  14. <tr>
  15. <th>Nazwa</th>
  16. <th>Koszt(szt.)</th>
  17. <th>Ilość</th>
  18. <th>Koszt całkowity</th>
  19. <th></th>
  20. </tr>
  21. <tr><form action="" name="form1" onsubmit="return false;">
  22. <td><input type="text" name="nazwa"></td>
  23. <td><input type="text" name="koszt"></td>
  24. <td><input type="text" name="ilosc" size="3"></td>
  25. <td><output type="text" name="output" id="out"></td>
  26. <td><input type="submit" name="button" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out')"></td>
  27. </form>
  28. </tr>
  29. <tr><form action="" name="2" onsubmit="return false;">
  30. <td><input type="text" name="nazwa"></td>
  31. <td><input type="text" name="koszt"></td>
  32. <td><input type="text" name="ilosc" size="3"></td>
  33. <td><output type="text" name="all2" id="out1"></output></td>
  34. <td><input type="submit" name="button2" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out1')"></td>
  35. </form>
  36. </tr>
  37. <tr><form action="" name="3" onsubmit="return false;">
  38. <td><input type="text" name="nazwa"></td>
  39. <td><input type="text" name="koszt"></td>
  40. <td><input type="text" name="ilosc" size="3"></td>
  41. <td><output type="text" name="all3" id="out2"></output></td>
  42. <td><input type="submit" name="button3" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out2')"></td>
  43. </form>
  44. </tr>
  45. <tr><form action="" name="4" onsubmit="return false;">
  46. <td><input type="text" name="nazwa"></td>
  47. <td><input type="text" name="koszt"></td>
  48. <td><input type="text" name="ilosc" size="3"></td>
  49. <td><output type="text" name="all4" id="out3"></output></td>
  50. <td><input type="submit" name="button4" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out3')""></td>
  51. </form>
  52. </tr>
  53. </table>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement