Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <script type="text/javascript">
  2. function licz(formularz){
  3. if (formularz.a.value==""|formularz.b.value=="")
  4. alert("Wprowadź dane");
  5. else{
  6. a=formularz.a.value;
  7. b=formularz.b.value;
  8. formularz.p.value=a*b;
  9. formularz.o.value=2*a+2*b;;
  10. }
  11. }
  12. </script>
  13.  
  14. <form name="formularz1" action="">
  15. Podaj bok a: <input type="text" name="a"><br><br>
  16. Podaj bok b: <input type="text" name="b"><br><br>
  17. <input type="button" value="Oblicz" onClick="licz(this.form)"><br><br>
  18. Wynik:<br><br>
  19. Pole prostokąta: <input type="text" name="p"><br><br>
  20. Obwód prostokąta: <input type="text" name="o">
  21. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement