survey/js/components/admin_erfassen.js
2023-03-21 14:17:05 +01:00

46 lines
1.4 KiB
JavaScript

function onClickDelete(id){
document.getElementById("antwort").value= "";
r = confirm('Antwort löschen1?');
if(r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'delete',
'tabelle': 'jumi_umfragen_antworten',
'spalte': 'uaid',
'id': id
},
success: function(result) { //we got the response
alert(result);
},
error: function(xhr, status, exception) {
console.log(xhr);
}
});
}
}
function onClickDeleteQuestion(id2){
document.getElementById("frage").value = "";
document.getElementById("antwort").value= "";
r = confirm('Gesamte Frage löschen?');
if(r) {
$.ajax({
type: 'POST',
url: '../controller/admin_erfassen.php',
data: {
'function': 'deleteQuestion',
'id2': id2
},
success: function(result){
// document.getElementById("del").innerHTML = "<strong>entfernt</strong>";
//Text einblenden geht nicht, da ein Refresh gemacht wird. Dann sieht man den Text nicht
}
});
}
}