Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function oblicz()
- {
- var canproceed = true;
- var liczba = Math.round(document.getElementById("liczba").value);
- var upust = document.getElementById("upust").checked;
- var polewynik = document.getElementById("wynik");
- if(liczba <= 0){polewynik.innerHTML = "Liczba musi być większa niż 0!"; canproceed = false;}
- if(canproceed)
- {
- var wynik = 0;
- if(liczba <= 50)
- {
- if(upust)
- {
- wynik = liczba * 1.8;
- }
- else
- {
- wynik = liczba * 2;
- }
- }
- else
- {
- if(upust)
- {
- wynik = liczba * 0.8;
- }
- else
- {
- wynik = liczba * 1;
- }
- }
- polewynik.innerHTML = "Koszt ogłoszeń: " + wynik + " PLN";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement