Well, I'm setting up a ticketing system and decided to switch the closed ticket message from a alert
to a dialog, it would be toast of materialize.com. But I am not able to make it return already executed, without having to click the button for it as in the materialize website.
The code in java / ajax is that.
$(function() {
$(".fechar").click(function(){
var element = $(this);
var select_ticket = element.attr("close");
var select_table = element.attr("ticket_table");
var mail = element.attr("mail");
var info = {
'close': select_ticket,
'ticket_table': select_table,
'mail': mail
}
if(confirm('Tem certeza que deseja fechar o ticket?'))
{
$.ajax({
type: "POST",
url: "assets/inc/del/ticket.php",
data: info,
success: function(){
alert("Fechado com sucesso!");
}
});
}
return false;
});
});