Commit df2129e8 authored by Pierre M's avatar Pierre M
Browse files

forbid form submission when clicking on buttons


Signed-off-by: Pierre M's avatarPierre Mazière <pierre.maziere@gmx.com>
parent 58e9a134
......@@ -110,7 +110,10 @@
if( user !== alias ){
button.appendChild(document.createTextNode("' alias '"+alias+"'"));
}
button.addEventListener("click",function(){plonk(user,alias);},true);
button.addEventListener("click",function(e){
plonk(user,alias);
e.preventDefault();
},true);
let p = document.createElement("p");
let select = document.createElement("select");
......@@ -145,14 +148,20 @@
button = document.createElement("button");
button.appendChild(document.createTextNode("Supprimer la sélection"));
button.addEventListener("click",function(){unplonk(user,alias);},true);
button.addEventListener("click",function(e){
unplonk(user,alias);
e.preventDefault();
},true);
if(Object.keys(plonkList).length){
form.appendChild(button);
}
button = document.createElement("button");
button.appendChild(document.createTextNode("Fermer"));
button.addEventListener("click",function(){closePlonkList();},true);
button.addEventListener("click",function(e){
closePlonkList();
e.preventDefault();
},true);
form.appendChild(button);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment