Szablon:Edycja: Różnice pomiędzy wersjami

Z Altaron Wiki
Nie podano opisu zmian
(dodanie klas błędu dla pola docelowego poziomu)
Linia 34: Linia 34:
       </div>
       </div>
       <div class="form-group">
       <div class="form-group">
         <label for="targetLevel">Wybierz docelowy poziom:</label>
         <label for="targetLevel" id="targetLevelLabel">Wybierz docelowy poziom:</label>
         <select class="form-control" id="targetLevel">
         <select class="form-control" id="targetLevel" onfocus="clearInputErrors()">
         </select>
         </select>
       </div>
       </div>
Linia 73: Linia 73:
   if (targetLevel > limit) {
   if (targetLevel > limit) {
     document.getElementById("pointsNeeded").innerHTML ="Docelowy poziom jest większy niż maksymalny poziom " + limit + ".";
     document.getElementById("pointsNeeded").innerHTML ="Docelowy poziom jest większy niż maksymalny poziom " + limit + ".";
    document.getElementById("targetLevel").classList.add("is-invalid");
    document.getElementById("targetLevelLabel").classList.add("text-danger")
     return;
     return;
   }
   }
Linia 86: Linia 88:


         document.getElementById("pointsNeeded").innerHTML = "Brakuje Ci " + pointsNeeded + " punktów nauki.";  
         document.getElementById("pointsNeeded").innerHTML = "Brakuje Ci " + pointsNeeded + " punktów nauki.";  
  }
 
  function clearInputErrors(){
    document.getElementById("targetLevel").classList.remove("is-invalid");
    document.getElementById("targetLevelLabel").classList.remove("text-danger")
   }
   }
</script>
</script>

Wersja z 14:35, 14 lut 2023

Zwój Przemiany.gif Kalkulator Punktów Nauki