button toggle show all

This commit is contained in:
Tykayn 2025-05-28 17:15:47 +02:00 committed by tykayn
parent 1e02b7062d
commit 14f28ef405
2 changed files with 30 additions and 0 deletions

View file

@ -34,5 +34,21 @@ document.addEventListener('DOMContentLoaded', () => {
bodyLanding.style.backgroundColor = randombg;
}
// Gestion du bouton pour afficher tous les champs
const btnShowAllFields = document.querySelector('#showAllFields');
if (btnShowAllFields) {
console.log('btnShowAllFields détecté');
btnShowAllFields.addEventListener('click', () => {
// Sélectionner tous les inputs dans le formulaire
const form = document.querySelector('form');
if (form) {
const hiddenInputs = form.querySelectorAll('.d-none');
hiddenInputs.forEach(input => {
input.classList.toggle('d-none');
});
}
});
}
});