Reputation: 11
I want the dialog box to open when the user clicks on the delete button (input type="submit"), but nothing happens, not even a JS error.
Code :
$(function() {
$( "#dialog-confirm" ).dialog({
autoOpen: false,
resizable: true,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
"Delete": function() {
$.ajax({
type: "post",
url: "delete.php",
data: "eridTBD=" + eridTBD,
context: $( "h1" ).first(),
error: function(){
$( this ).after( "<p>no dice</p>" );
},
success: function( results ){
$( this ).after( results )
}
});
$( this ).dialog("close");
},
Cancel: function() {
$( this ).dialog("close");
}
}
});
$( ".delete_form input[name=delete]" ).click(function() {
$( "dialog-confirm" ).dialog( "open" );
return false;
});
});
Any suggestions?
Upvotes: 0
Views: 1835
Reputation: 77956
Missed the pound sign:
$( "dialog-confirm" ).dialog( "open" );
should be
$( "#dialog-confirm" ).dialog( "open" );
Upvotes: 1