help show dialog return true false
some of my page content I cannot change as its generated by the server ,
for example
my server generates this code
- <a href="#" id="deleteLink54" onclick="if(!confirm('Are you sure you want to delete?')) return false;var wcall=wicketAjaxGet('?x=z12gKfTAS1nMK-rWQvvTcgIWpk3l8d8hmfKCNYTSVUiA-t2d2o9eau0xd1*zS*exbWtaUKv-pe7zMozBPBI0FGcDSyZ3O7FJeZ6y1k0FlgEsF6MvnfsXPXOWplSlW9LK',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('deleteLink54') != null;}.bind(this));return !wcall;">Delete</a>
all I can change in the above code is
- if(!confirm('Are you sure you want to delete?')) return false;
here the confirm creates javascript alert and I want to replace this with jquery dialog, but I am not able to write a function whihc shows a jquery dialog and after its closed return true or false
here is my jquery dialog function
- function fnComfirm(title, content) {
- $("#confirm-dialog span").html(content);
- $("#confirm-dialog").dialog({
- title: title,
- resizable: false,
- height: 200,
- width: 486,
- modal: true,
- buttons: {
- "OK": function() {
- $( this ).dialog("close");
- callback(true);
- },
- Cancel: function() {
- $( this ).dialog("close");
- callback(false);
- }
- }
- });
- }
- function callback(value){
- console.log(value);
- return value;
- }
please advice me how to have the dialog return true or false .