consolidate all repos to one for archive
This commit is contained in:
68
semester_1/uvod_v_svetovni_splet/Vaja_4/Test/script.js
Normal file
68
semester_1/uvod_v_svetovni_splet/Vaja_4/Test/script.js
Normal file
@@ -0,0 +1,68 @@
|
||||
var uporabniskoIme = null;
|
||||
var usernameWarningSpan = null;
|
||||
var passwordInput = null;
|
||||
var passwprdWarnignSpan = null;
|
||||
var submitButton = null;
|
||||
|
||||
window.onload = (event) =>
|
||||
{
|
||||
uporabniskoIme = document.getElementById("uporabniskoIme");
|
||||
usernameWarningSpan = document.getElementById("usernameWarning")
|
||||
passwordInput = document.getElementById("passwordInput")
|
||||
passwprdWarnignSpan = document.getElementById("passwordWarning")
|
||||
submitButton = document.getElementById("submitButton");
|
||||
|
||||
checkSubmit()
|
||||
};
|
||||
|
||||
function onUsernameChange()
|
||||
{
|
||||
|
||||
if(/^[a-zA-Z0-9_.,]+$/.test(uporabniskoIme.value)) //ustrezno uporabnisko ime
|
||||
{
|
||||
usernameWarningSpan.setAttribute("class", "correctInput");
|
||||
usernameWarningSpan.innerHTML = "Primerno uporavniško ime";
|
||||
}
|
||||
|
||||
else //neustrezno uporabnisko ime
|
||||
{
|
||||
usernameWarningSpan.setAttribute("class", "incorrectInput");
|
||||
usernameWarningSpan.innerHTML = "Neprimerno uporavniško ime";
|
||||
}
|
||||
|
||||
checkSubmit()
|
||||
}
|
||||
|
||||
/*^[a-zA-Z0-9_.,]*[A-Z]+[a-zA-Z0-9_.,]*$ */
|
||||
|
||||
function onPasswordChange()
|
||||
{
|
||||
if(/^[a-zA-Z0-9_.,]+$/.test(passwordInput.value) && passwordInput.value.length >= 6)
|
||||
{
|
||||
passwprdWarnignSpan.setAttribute("class", "correctInput");
|
||||
passwprdWarnignSpan.innerHTML = "Primerno geslo";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
passwprdWarnignSpan.setAttribute("class", "incorrectInput");
|
||||
passwprdWarnignSpan.innerHTML = "Neprimerno geslo";
|
||||
}
|
||||
|
||||
checkSubmit()
|
||||
}
|
||||
|
||||
function checkSubmit()
|
||||
{
|
||||
const usernameWarningClass = usernameWarningSpan.getAttribute("class");
|
||||
const passwordWarningClass = passwordWarnignSpan.getAttribute("class");
|
||||
|
||||
//ali "incorectInput" ali "CorrectInput"
|
||||
if(usernameWarningClass == 'IncorrectInput' || passwordWarningClass == 'IncorrectInput')
|
||||
{
|
||||
submitButton.disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
submitButton.disabled = false;
|
||||
}
|
33
semester_1/uvod_v_svetovni_splet/Vaja_4/Test/styles.css
Normal file
33
semester_1/uvod_v_svetovni_splet/Vaja_4/Test/styles.css
Normal file
@@ -0,0 +1,33 @@
|
||||
html {
|
||||
min-height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100%;
|
||||
height: 100%;
|
||||
background-color: lightblue;
|
||||
}
|
||||
|
||||
.selectedCell {
|
||||
background-color: red;
|
||||
border: 1px solid black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.colorTable * {
|
||||
border: 1px solid black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#usernameWarning, #passwordWarning {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.correctInput {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.incorrectInput {
|
||||
color: darkred;
|
||||
}
|
Reference in New Issue
Block a user