Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- <script type="text/javascript">
- function calc(a,b, out)
- {
- document.getElementById(out).value = a*b;
- }
- </script>
- </head>
- <body>
- <table>
- <tr>
- <th>Nazwa</th>
- <th>Koszt(szt.)</th>
- <th>Ilość</th>
- <th>Koszt całkowity</th>
- <th></th>
- </tr>
- <tr><form action="" name="form1" onsubmit="return false;">
- <td><input type="text" name="nazwa"></td>
- <td><input type="text" name="koszt"></td>
- <td><input type="text" name="ilosc" size="3"></td>
- <td><output type="text" name="output" id="out"></td>
- <td><input type="submit" name="button" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out')"></td>
- </form>
- </tr>
- <tr><form action="" name="2" onsubmit="return false;">
- <td><input type="text" name="nazwa"></td>
- <td><input type="text" name="koszt"></td>
- <td><input type="text" name="ilosc" size="3"></td>
- <td><output type="text" name="all2" id="out1"></output></td>
- <td><input type="submit" name="button2" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out1')"></td>
- </form>
- </tr>
- <tr><form action="" name="3" onsubmit="return false;">
- <td><input type="text" name="nazwa"></td>
- <td><input type="text" name="koszt"></td>
- <td><input type="text" name="ilosc" size="3"></td>
- <td><output type="text" name="all3" id="out2"></output></td>
- <td><input type="submit" name="button3" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out2')"></td>
- </form>
- </tr>
- <tr><form action="" name="4" onsubmit="return false;">
- <td><input type="text" name="nazwa"></td>
- <td><input type="text" name="koszt"></td>
- <td><input type="text" name="ilosc" size="3"></td>
- <td><output type="text" name="all4" id="out3"></output></td>
- <td><input type="submit" name="button4" value="Przelicz" onclick="calc(koszt.value, ilosc.value, 'out3')""></td>
- </form>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement