Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- function licz(formularz){
- if (formularz.a.value==""|formularz.b.value=="")
- alert("Wprowadź dane");
- else{
- a=formularz.a.value;
- b=formularz.b.value;
- formularz.p.value=a*b;
- formularz.o.value=2*a+2*b;;
- }
- }
- </script>
- <form name="formularz1" action="">
- Podaj bok a: <input type="text" name="a"><br><br>
- Podaj bok b: <input type="text" name="b"><br><br>
- <input type="button" value="Oblicz" onClick="licz(this.form)"><br><br>
- Wynik:<br><br>
- Pole prostokąta: <input type="text" name="p"><br><br>
- Obwód prostokąta: <input type="text" name="o">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement