I have a function to delete table rows like this:
$(document).on("click", ".delete", function(){
var id = $(this).parents("tr").attr("id");
var idutente = $(this).parents("tr").attr("id_utente");
var nomeutente = $(this).parents("tr").attr("nomeutente");
if(confirm('Tem certeza de que deseja excluir a requisição?'))
{
$.ajax({
url: './deleteutente1',
type: 'GET',
data: {id: id, idutente: idutente, nomeutente: nomeutente},
error: function() {
alert('Algo está errado!');
},
success: function(data) {
$("#"+id).remove();
alert("Requisição removida com sucesso");
}
});
}
});
When the alert was displayed, I want a textarea to be displayed to the user to put the reason for removal and insert it into a database table, but I don't understand how to do that.
confirmation window, try to use modal, like bootstrap modal, you will have a full control to do whatever you want to do.id_utente&nomeutente. Usedataattribute for custom properties