Skip to content

Commit

Permalink
fixes OpenClassrooms-Student-Center#2, correction d'un bug sur la che…
Browse files Browse the repository at this point in the history
…ckbox qui acccepte les CGV qui envoyé les données même décoché
  • Loading branch information
ChrisP committed Apr 26, 2021
1 parent 88b8b3f commit 002f210
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion starterOnly/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ <h1 class="hero-headline">Marathon national<br>de jeux vidéos</h1>
<label class="checkbox2-label" for="checkbox1">
<span class="checkbox-icon"></span>J'ai lu et accepté les conditions d'utilisation.</label><br>

<input class="checkbox-input" type="checkbox" id="checkbox2" name="checkbox2" />
<input class="checkbox-input" id="checkbox2" name="checkbox2" />
<label class="checkbox2-label" for="checkbox2">
<span class="checkbox-icon"></span>Je souhaite être prévenu des prochains évènements.</label><br>

Expand Down
12 changes: 6 additions & 6 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const regexCompetition = new RegExp(/^[0-9]{1,}/);

document.forms[0].addEventListener("submit", (e) => {
// Cration d'une variable qui servira a stocké les messages d'erreurs
e.preventDefault();

let erreur;

// si la valeur retourné est différent de la regex => informé l'utilisateur de l'erreur
Expand Down Expand Up @@ -107,15 +107,15 @@ document.forms[0].addEventListener("submit", (e) => {
input[2].value &&
input[3].value &&
input[4].value &&
radio[0].checked ||
(radio[0].checked ||
radio[1].checked ||
radio[2].checked ||
radio[3].checked ||
radio[4].checked ||
radio[5].checked &&
checkbox.checked
) {
alert("FORMULAIRE ENVOYE AVEC SUCCES");
radio[5].checked) &&
checkbox.checked === true
) {
alert("FORMULAIRE ENVOYE AVEC SUCCES");

// sinon n'envoi pas le formulaire via la demande de comportement par défault
} else {
Expand Down

0 comments on commit 002f210

Please sign in to comment.