Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <title>funkcje js</title>
- <meta charset="utf-8" />
- </head>
- <body>
- <script>
- function licz(formularz)
- {
- if (formularz.a.value=='' || formularz.b.value=='') alert ('Wprowadź dane'); else
- {
- a=formularz.a.value;
- b=formularz.b.value;
- a=formularz.a.value;
- formularz.p.value=a*b;
- formularz.o.value=2*a+2*b;
- }
- }
- </script>
- <form name="form1" 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>
- Pole prostokąta: <input type="text" name="p"><br><br>
- Obwód prostokąta: <input type="text" name="o">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement