Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <body>
- <input type="checkbox" id="1" name="BE" value="1">
- <label for="1">Marko (BE)</label><br>
- <input type="checkbox" id="2" name="BE" value="1">
- <label for="2">Janko (BE)</label><br>
- <input type="checkbox" id="3" name="BE" value="1">
- <label for="3">Jovan (BE)</label><br>
- <input type="checkbox" id="4" name="FE" value="1">
- <label for="4">Ilija (FE)</label><br>
- <input type="checkbox" id="5" name="FE" value="1">
- <label for="5">Petar (FE)</label><br>
- <input type="checkbox" id="6" name="FE" value="1">
- <label for="6">Dusan (FE)</label><br>
- <input type="checkbox" id="7" name="QA" value="1">
- <label for="7">Petar (QA)</label><br>
- <input type="checkbox" id="8" name="QA" value="1">
- <label for="8">Lazar (QA)</label><br>
- <input type="checkbox" id="9" name="QA" value="1">
- <label for="9">Filip (QA)</label><br>
- <script>
- function a() {
- var BE=0; //back end count
- var FE=0; //font end count
- var QA=0; //qa count
- var i=0; //general purpose counter
- var dostupnost=document.getElementById("1").value //availability factor
- var checkBox=document.getElementById("1");
- }
- if(checkBox.checked==true){
- i=i+parseFloat(dostupnost);
- BE++;
- }
- var dostupnost=document.getElementById("2").value
- var checkBox=document.getElementById("2");
- if(checkBox.checked==true){
- BE++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("3").value
- var checkBox=document.getElementById("3");
- if(checkBox.checked==true){
- BE++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("4").value
- var checkBox=document.getElementById("4");
- if(checkBox.checked==true){
- FE++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("5").value
- var checkBox=document.getElementById("5");
- if(checkBox.checked==true){
- FE++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("6").value
- var checkBox=document.getElementById("6");
- if(checkBox.checked==true){
- FE++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("7").value
- var checkBox=document.getElementById("7");
- if(checkBox.checked==true){
- QA++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("8").value
- var checkBox=document.getElementById("8");
- if(checkBox.checked==true){
- QA++;
- i=i+parseFloat(dostupnost);
- }
- var dostupnost=document.getElementById("9").value
- var checkBox=document.getElementById("9");
- if(checkBox.checked==true){
- QA++;
- i=i+parseFloat(dostupnost);
- }
- if (i<=6 && BE>=1 && BE<=2 && FE>=2 && BE<=3 && QA==1){ //me checking the conditions?
- alert("True");
- }
- else{
- alert("False");
- }
- </script>
- <button type="button" onclick="a()">Prijavi</button>
- </body>
- </head>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement