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>
|
<a href="recapitulatif.html" class="btn">Continuer</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script>
|
<script src="script.js"></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>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -36,5 +36,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -73,6 +73,8 @@
|
|||||||
<a href="validations.html" class="btn">Continuer</a>
|
<a href="validations.html" class="btn">Continuer</a>
|
||||||
<a href="dates.html" class="btn">Modifier</a>
|
<a href="dates.html" class="btn">Modifier</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -20,14 +20,14 @@
|
|||||||
<section>
|
<section>
|
||||||
<p>
|
<p>
|
||||||
Je m'appelle
|
Je m'appelle
|
||||||
<input name="nom" />
|
<input name="nom" data-group="record" />
|
||||||
et le titre de ce sondage
|
et le titre de ce sondage
|
||||||
<select id="type_sondage">
|
<select id="type_sondage" data-group="record">
|
||||||
<option>classique</option>
|
<option>classique</option>
|
||||||
<option>special dates</option>
|
<option>special dates</option>
|
||||||
</select>
|
</select>
|
||||||
est
|
est
|
||||||
<input name="titre" />.
|
<input name="titre" data-group="record"/>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Si je devais le décrire pour les autres personnes, je dirais
|
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="notifications.html" class="btn">Continuer</a>
|
||||||
<a href="dates.html" class="btn">Modifier</a>
|
<a href="dates.html" class="btn">Modifier</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -39,11 +39,7 @@
|
|||||||
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<script>
|
<script src="script.js"></script>
|
||||||
window.onload = () => {
|
|
||||||
var monStockage = localStorage;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -1,19 +1,21 @@
|
|||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
var monStockage = localStorage;
|
if(localStorage.getItem('type_sondage') == null) {
|
||||||
if(localStorage.getItem('type_sondage') == undefined) {
|
|
||||||
localStorage.setItem('type_sondage', 'classique');
|
localStorage.setItem('type_sondage', 'classique');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.querySelector('#type_sondage').addEventListener('change', function() {
|
console.debug(localStorage)
|
||||||
|
|
||||||
|
let typeSondageElement = document.querySelectorAll("*[data-group='record']")
|
||||||
|
typeSondageElement.forEach((currentElement) => {
|
||||||
|
currentElement.addEventListener('change', function() {
|
||||||
const selectedType = this.options[this.selectedIndex].text;
|
const selectedType = this.options[this.selectedIndex].text;
|
||||||
localStorage.setItem('type_sondage', type_sondage);
|
localStorage.setItem('type_sondage', type_sondage);
|
||||||
console.log(selectedType);
|
|
||||||
if(selectedType == "classique") {
|
if(selectedType == "classique") {
|
||||||
document.querySelector('#next').href = "reponses.html";
|
document.querySelector('#next').href = "reponses.html";
|
||||||
} else {
|
} else {
|
||||||
document.querySelector('#next').href = "dates.html";
|
document.querySelector('#next').href = "dates.html";
|
||||||
}
|
}
|
||||||
console.log(document.querySelector('#next'))
|
|
||||||
})
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,10 +21,7 @@
|
|||||||
<h1>C'est tout bon !</h1>
|
<h1>C'est tout bon !</h1>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user