Skip to content

Commit

Permalink
issue 5: fermer le modal OpenClassrooms-Student-Center#5
Browse files Browse the repository at this point in the history
  • Loading branch information
uu-0 committed Jun 14, 2024
1 parent 38c4d77 commit f7d1225
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion starterOnly/modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ input {
display: block;
margin-top: 7px;
margin-bottom: 7px;
text-align: right;
text-align: left;
line-height: 0.3;
opacity: 0;
transition: 0.3s;
Expand Down
10 changes: 4 additions & 6 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,16 @@ function validate(e) {
hideValidationError(formData[4]);
}

//validation séléction tournois
let tournamentChoice = document.querySelector("input[type=radio]:checked").value;
console.log(tournamentChoice);
//validation sélection tournois
let tournamentChoice = document.querySelector("input[type=radio]:checked");
if (!tournamentChoice) {
showValidationError(formData[5], "Veuillez sélectionner un tournoi");
} else {
//séléction tournois validée
hideValidationError(formData[5]);
}

//validation conditions d'utilisations
//validation conditions d'utilisation
let conditionsOfUseCheckbox = document.querySelector("#checkbox1");
if (!conditionsOfUseCheckbox.checked) {
showValidationError(formData[6], "Veuillez lire et accepter les conditions d'utilisation");
Expand All @@ -132,8 +131,7 @@ function validate(e) {
//envoi du formulaire s'il n'y a plus d'erreur de validation, affiche les remerciments
let visibleErrors = document.querySelectorAll("[data-error-visible=true]");
if (visibleErrors.length === 0) {
/*inscriptionForm.submit();*/
console.log('le formulaire a été envoyé bg');
inscriptionForm.submit();
launchThanks();
}
}

0 comments on commit f7d1225

Please sign in to comment.