BARRAUX Arthur
3 years ago
1 changed files with 0 additions and 42 deletions
@ -1,42 +0,0 @@ |
|||
const button = document.getElementById('submit'); |
|||
const page = document.getElementById('page'); |
|||
|
|||
const check = document.getElementsByClassName('check'); |
|||
const excla = document.getElementsByClassName('excla'); |
|||
const entry = document.getElementsByClassName('entry'); |
|||
const help = document.getElementsByClassName('help'); |
|||
|
|||
|
|||
function displayHelp(id) { |
|||
id.style.display = 'block'; |
|||
} |
|||
|
|||
function hideHelp(id) { |
|||
id.style.display = 'none'; |
|||
} |
|||
|
|||
function checkInputs() { |
|||
for (let i=0; i < entry.length ; i++) { |
|||
console.log(i); |
|||
if (entry[i].type != 'button') { |
|||
if (entry[i].value == '') { |
|||
setError(i); |
|||
} |
|||
else { |
|||
setSuccess(i); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
function setError(indice) { |
|||
check[indice].style.display = 'none'; |
|||
excla[indice].style.display = 'block'; |
|||
document.getElementsByTagName('small')[indice].style.display = 'block'; |
|||
} |
|||
|
|||
function setSuccess(indice) { |
|||
check[indice].style.display = 'block'; |
|||
excla[indice].style.display = 'none'; |
|||
document.getElementsByTagName('small')[indice].style.display = 'none'; |
|||
} |
Loading…
Reference in new issue