Hello coders,
a friend of me asked for a little help,
he had a confirm() dialog in javascript to confirm a deletion
however he wants to use
jqueryui dialog modal-confirmation
the problem is that we can't get it working
I hope that you guys can help
'working' script with confirm():
Code:
<script type="text/javascript" >
function deleterow(id){
if (confirm('Ben je zeker dat je deze gebruiker wilt verwijderen?')) {
$.post('quit.php', {id: +id, ajax: 'true' },
function(){
$("."+id).fadeOut("slow");
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
});
}
}
</script>
above code works, but uses a simple confirm() dialog
several attempts in making it work with JQUI failed
one of the attempts:
Code:
<script type="text/javascript" >
function deleteconfirmed(id){
document.write("Hello World!");
$.post('quit.php', {id: +id, ajax: 'true' },
function(){
$("."+id).fadeOut("slow");
$(".message").fadeIn("slow");
$(".message").delay(2000).fadeOut(1000);
});
}
$(function() {
$( "#dialog-confirm" ).dialog({
autoOpen: false,
resizable: false,
height:140,
modal: true,
buttons: {
"Delete item": function() {
deleteconfirmed();
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
function deleterow(id){
$('#dialog-confirm').dialog('open');
return false;
}
});
</script>
Please help us out,
Best Regards, JLS Jonas