mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
Bifurcation sur le sondate en fonction du choix
This commit is contained in:
parent
b3b9797e8c
commit
0f6abfa7b9
@ -33,17 +33,7 @@
|
||||
<a href="recapitulatif.html" class="btn">Continuer</a>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
window.onload = () => {
|
||||
console.log("truc");
|
||||
var monStockage = localStorage;
|
||||
console.log("key ? storage : ", localStorage.type_sondage);
|
||||
|
||||
document.querySelector('#type_sondage').addEventListener('change', function() {
|
||||
localStorage.setItem('type_sondage', this.options[this.selectedIndex].text);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -36,5 +36,6 @@
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -73,6 +73,8 @@
|
||||
<a href="validations.html" class="btn">Continuer</a>
|
||||
<a href="dates.html" class="btn">Modifier</a>
|
||||
</nav>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -20,14 +20,14 @@
|
||||
<section>
|
||||
<p>
|
||||
Je m'appelle
|
||||
<input name="nom" />
|
||||
<input name="nom" data-group="record" />
|
||||
et le titre de ce sondage
|
||||
<select id="type_sondage">
|
||||
<select id="type_sondage" data-group="record">
|
||||
<option>classique</option>
|
||||
<option>special dates</option>
|
||||
</select>
|
||||
est
|
||||
<input name="titre" />.
|
||||
<input name="titre" data-group="record"/>.
|
||||
</p>
|
||||
<p>
|
||||
Si je devais le décrire pour les autres personnes, je dirais
|
||||
|
@ -52,6 +52,8 @@
|
||||
<a href="notifications.html" class="btn">Continuer</a>
|
||||
<a href="dates.html" class="btn">Modifier</a>
|
||||
</nav>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -39,11 +39,7 @@
|
||||
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
window.onload = () => {
|
||||
var monStockage = localStorage;
|
||||
}
|
||||
</script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@ -1,19 +1,21 @@
|
||||
window.onload = () => {
|
||||
var monStockage = localStorage;
|
||||
if(localStorage.getItem('type_sondage') == undefined) {
|
||||
if(localStorage.getItem('type_sondage') == null) {
|
||||
localStorage.setItem('type_sondage', 'classique');
|
||||
}
|
||||
|
||||
document.querySelector('#type_sondage').addEventListener('change', function() {
|
||||
const selectedType = this.options[this.selectedIndex].text;
|
||||
localStorage.setItem('type_sondage', type_sondage);
|
||||
console.log(selectedType);
|
||||
if(selectedType == "classique") {
|
||||
document.querySelector('#next').href = "reponses.html";
|
||||
} else {
|
||||
document.querySelector('#next').href = "dates.html";
|
||||
}
|
||||
console.log(document.querySelector('#next'))
|
||||
})
|
||||
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";
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,7 @@
|
||||
<h1>C'est tout bon !</h1>
|
||||
</section>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user