Advertisement
Guest User

Untitled

a guest
Dec 9th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <body>
  6.  
  7.  
  8. <input type="checkbox" id="1" name="BE" value="1">
  9. <label for="1">Marko (BE)</label><br>
  10.  
  11. <input type="checkbox" id="2" name="BE" value="1">
  12. <label for="2">Janko (BE)</label><br>
  13.  
  14. <input type="checkbox" id="3" name="BE" value="1">
  15. <label for="3">Jovan (BE)</label><br>
  16.  
  17. <input type="checkbox" id="4" name="FE" value="1">
  18. <label for="4">Ilija (FE)</label><br>
  19.  
  20. <input type="checkbox" id="5" name="FE" value="1">
  21. <label for="5">Petar (FE)</label><br>
  22.  
  23. <input type="checkbox" id="6" name="FE" value="1">
  24. <label for="6">Dusan (FE)</label><br>
  25.  
  26. <input type="checkbox" id="7" name="QA" value="1">
  27. <label for="7">Petar (QA)</label><br>
  28.  
  29. <input type="checkbox" id="8" name="QA" value="1">
  30. <label for="8">Lazar (QA)</label><br>
  31.  
  32. <input type="checkbox" id="9" name="QA" value="1">
  33. <label for="9">Filip (QA)</label><br>
  34.  
  35.  
  36.  
  37. <script>
  38. function a() {
  39. var BE=0; //back end count
  40. var FE=0; //font end count
  41. var QA=0; //qa count
  42. var i=0; //general purpose counter
  43. var dostupnost=document.getElementById("1").value //availability factor
  44. var checkBox=document.getElementById("1");
  45. }
  46. if(checkBox.checked==true){
  47. i=i+parseFloat(dostupnost);
  48. BE++;
  49. }
  50.  
  51. var dostupnost=document.getElementById("2").value
  52. var checkBox=document.getElementById("2");
  53. if(checkBox.checked==true){
  54. BE++;
  55. i=i+parseFloat(dostupnost);
  56. }
  57.  
  58.  
  59. var dostupnost=document.getElementById("3").value
  60. var checkBox=document.getElementById("3");
  61. if(checkBox.checked==true){
  62. BE++;
  63. i=i+parseFloat(dostupnost);
  64. }
  65.  
  66.  
  67. var dostupnost=document.getElementById("4").value
  68. var checkBox=document.getElementById("4");
  69. if(checkBox.checked==true){
  70. FE++;
  71. i=i+parseFloat(dostupnost);
  72. }
  73.  
  74. var dostupnost=document.getElementById("5").value
  75. var checkBox=document.getElementById("5");
  76. if(checkBox.checked==true){
  77. FE++;
  78. i=i+parseFloat(dostupnost);
  79. }
  80.  
  81. var dostupnost=document.getElementById("6").value
  82. var checkBox=document.getElementById("6");
  83. if(checkBox.checked==true){
  84. FE++;
  85. i=i+parseFloat(dostupnost);
  86. }
  87.  
  88. var dostupnost=document.getElementById("7").value
  89. var checkBox=document.getElementById("7");
  90. if(checkBox.checked==true){
  91. QA++;
  92. i=i+parseFloat(dostupnost);
  93. }
  94.  
  95. var dostupnost=document.getElementById("8").value
  96. var checkBox=document.getElementById("8");
  97. if(checkBox.checked==true){
  98. QA++;
  99. i=i+parseFloat(dostupnost);
  100. }
  101.  
  102. var dostupnost=document.getElementById("9").value
  103. var checkBox=document.getElementById("9");
  104. if(checkBox.checked==true){
  105. QA++;
  106. i=i+parseFloat(dostupnost);
  107. }
  108.  
  109. if (i<=6 && BE>=1 && BE<=2 && FE>=2 && BE<=3 && QA==1){ //me checking the conditions?
  110. alert("True");
  111. }
  112. else{
  113. alert("False");
  114. }
  115.  
  116.  
  117.  
  118. </script>
  119.  
  120. <button type="button" onclick="a()">Prijavi</button>
  121.  
  122. </body>
  123. </head>
  124. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement