Problem
Create a Dialog ( Confirm )
Solution Code
Dialog with a fixed height and width
$('<div></div>').appendTo('body').html(Dialog with a fixed height and width
'Are you sure You would like to do this ?')
.dialog({
resizable : false,
modal : true,
title : "Alert",
height : 150,
width : 400,
buttons : {
"Yes" : function() {
// Code to perform action on Yes
$(this).dialog('close');
}
"No" : function() {
// Code to perform action on No
$(this).dialog('close');
}
}
});
Dialog with expanding height and width
$('<div></div>').appendTo('body').html(
'Are you sure You would like to do this ?')
.dialog({
resizable : false,
modal : true,
title : "Confirmation",
buttons : {
"Yes" : function() {
// Code to perform action on Yes
$(this).dialog('close');
}
"No" : function() {
// Code to perform action on No
$(this).dialog('close');
}
}
});