-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscriptsJsCreateJudoka.html
More file actions
34 lines (34 loc) · 1.32 KB
/
scriptsJsCreateJudoka.html
File metadata and controls
34 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script>
function validateFields(input){
console.log(input.name.value.length)
if (input.name.value.length === 0){
const divName = document.getElementById('div-name');
const div = document.createElement('div');
div.className = "warning";
div.innerHTML = "Veuillez entrer un nom";
divName.appendChild(div);
setTimeout(()=>{
div.parentNode.removeChild(div);
}, 2000);
}else if (input.birthdate.value.length === 0){
const divBD = document.getElementById('div-birthdate');
const div = document.createElement('div');
div.className = "warning";
div.innerHTML = "Veuillez entrer la date de naissance";
divBD.appendChild(div);
setTimeout(()=>{
div.parentNode.removeChild(div);
}, 2000);
}else if (input.nationality.value.length === 0){
const divNat = document.getElementById('div-nat');
const div = document.createElement('div');
div.className = "warning";
div.innerHTML = "Veuillez entrer la nationalité";
divNat.appendChild(div);
setTimeout(()=>{
div.parentNode.removeChild(div);
}, 2000);
}else
google.script.run.addJudoka(input);
}
</script>