Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Jaroslaw on 2/21/2017.
- */
- var cors = document.getElementById("courses"),
- durn = document.getElementById("duration"),
- langs = document.getElementById("languages"),
- rept = document.getElementById("reporting");
- var nameUser = document.getElementById("userName"),
- surnameUser = document.getElementById("userSurname");
- var scost;
- window.onload = function () {
- countAll(parseInt(cors.options[cors.selectedIndex].value),
- parseInt(durn.options[durn.selectedIndex].value),
- parseInt(langs.options[langs.selectedIndex].value),
- parseInt(rept.options[rept.selectedIndex].value));
- };
- function countAll(c, d, l, r) {
- var sumaCost;
- sumaCost = d * c + l + r;
- scost = sumaCost;
- document.getElementById("costSingle").innerHTML = c;
- document.getElementById("costAll").innerHTML = sumaCost;
- }
- function coursesCount() {
- countAll(parseInt(cors.options[cors.selectedIndex].value),
- parseInt(durn.options[durn.selectedIndex].value),
- parseInt(langs.options[langs.selectedIndex].value),
- parseInt(rept.options[rept.selectedIndex].value));
- }
- function getCourse() {
- if (nameUser.value !== "" && surnameUser.value !== "")
- alert("Great! " + nameUser.value + " you get the course - " + cors.options[cors.selectedIndex].text + "! And total cost is - " + scost + " $");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement