0
Guys, I’m building a ticket system and I’ve decided to exchange a closed ticket message alert for a dialog, would be the Toast materialize.com. However, I am not able to make it return already executed, without having to click the button to do so as in the materialize site.
The java/ajax code is this.
$(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;
});
});
How are you invoking this
dialog?– Valdeir Psr
On the site of materialize, they give this code
<a class="btn" onclick="Materialize.toast('I am a toast!', 3000, 'rounded')">Toast!</a>but you need to have aonclickto execute. Only that my intention is that when making the change in the bank it already return thedialogexecuted, without the need to click the button.– Thomas Franklin