I am using jquery popModal in my javascript code as follows:
I can see the following based on my code:
- When I click on
Cancel
button the modal window gets closed which is because insideCancel
function, I have$(this).dialog("close")
defined. - Pressing
Save
button doesn’t closes which is obvious from the fact that$(this).dialog("close")
is commented out in my code below. - Pressing
Remove
is also closing the dialog and it’s not printing the console messages.
Could anyone tell me why it is behaving like this and how can I make the url print in the console.log?
Here is my code:
if (selectedField === "edit") {
$('#mywindowForModal').popModal({
html: $('#modalDialog').html()
});
$('#modalDialog').dialog({
position: { my: 'center', at: 'center' },
modal: true,
width: 350,
height: 150,
buttons: {
Cancel: function () {
$(this).dialog("close")
},
Save: function () {
/* $(this).dialog("close")*/
},
Remove: function () {
var url = "www.google.com";
console.log("Checking URL inside REMOVE Button: "+url);
$(this).dialog("close")
}
}
});