2018-09-28 22:59:58 +02:00
|
|
|
window.onload = () => {
|
2018-10-08 22:47:50 +02:00
|
|
|
if(localStorage.getItem('type_sondage') == null) {
|
2018-09-28 22:59:58 +02:00
|
|
|
localStorage.setItem('type_sondage', 'classique');
|
|
|
|
}
|
|
|
|
|
2018-10-08 22:47:50 +02:00
|
|
|
console.debug(localStorage)
|
|
|
|
|
|
|
|
let typeSondageElement = document.querySelectorAll("*[data-group='record']")
|
|
|
|
typeSondageElement.forEach((currentElement) => {
|
|
|
|
currentElement.addEventListener('change', function() {
|
|
|
|
const selectedType = this.options[this.selectedIndex].text;
|
|
|
|
localStorage.setItem('type_sondage', type_sondage);
|
|
|
|
if(selectedType == "classique") {
|
|
|
|
document.querySelector('#next').href = "reponses.html";
|
|
|
|
} else {
|
|
|
|
document.querySelector('#next').href = "dates.html";
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2018-09-28 22:59:58 +02:00
|
|
|
}
|
|
|
|
|