Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- </head>
- <body>
- <form name="form1">
- Numer kawy: <input type="number" name="liczba1"/><br>
- Waga kawy: <input type="number" name="liczba2"/><br>
- <br>
- <input type="button" onclick="sum()" value="Zamow"/>
- </form>
- <script>
- {if ((document.form1.liczba1.value=="")||(isNaN(document.form1.liczba1.value))) {alert("Błąd danych");}
- else
- if ((document.form1.liczba2.value=="")||(isNaN(document.form1.liczba2.value))) {alert("Błąd danych");}
- else
- var a = parseInt(document.form1.liczba1.value);
- var b = parseInt(document.form1.liczba2.value);
- var iloczyn = a * b;
- document.getElementById("wynik").innerHTML = iloczyn;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement