mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
Ajout d'un champ texte en cas de sondage classique
avancement sur le #20
This commit is contained in:
parent
cdbe0a12e1
commit
45319fcfd6
@ -29,14 +29,12 @@
|
||||
</select>
|
||||
</p>
|
||||
<ul id="responses">
|
||||
<li>
|
||||
<a href="responses.html" id="add-response-choice" class="btn next">Ajouter</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</section>
|
||||
|
||||
<nav>
|
||||
<a href="responses.html" id="add-response-choice" class="btn next">Ajouter</a>
|
||||
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
||||
<a href="responses.html" class="btn next">Tout effacer</a>
|
||||
</nav>
|
||||
|
@ -52,6 +52,16 @@ const createModal = (text) => {
|
||||
});
|
||||
}
|
||||
|
||||
const buildTextField = () => {
|
||||
var field = document.createElement("input")
|
||||
var deleteButton = document.createElement("button")
|
||||
var fieldBloc = document.createElement("span")
|
||||
fieldBloc.appendChild(field);
|
||||
fieldBloc.appendChild(deleteButton);
|
||||
return fieldBloc
|
||||
|
||||
}
|
||||
|
||||
$$('input').forEach((inputElement) => {
|
||||
inputElement.addEventListener("change", () => {
|
||||
localStorage[inputElement.name] = inputElement.value
|
||||
@ -62,13 +72,13 @@ if($("#add-response-choice")) {
|
||||
$("#add-response-choice").addEventListener('click', (e) => {
|
||||
e.preventDefault();
|
||||
let response = document.createElement("li");
|
||||
let text = document.createTextNode("Blabla");
|
||||
response.appendChild(text);
|
||||
response.appendChild(buildTextField());
|
||||
|
||||
$("#responses").appendChild(response);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$$(".next").forEach((button) => {
|
||||
button.addEventListener("click", (e) => {
|
||||
$$(".toggle-field").forEach((field) => {
|
||||
|
Loading…
Reference in New Issue
Block a user