Generic Confirm Function

Generic Confirm Function


I am new to jQuery, so I appologize if this has been answered before, but I couldnt find a relevant post here or via google. I have an embedded javascript file with the following function:
 
function ConfirmDialog(titleText, messageText) {
 
var content = "<div id='dialog' title='" + titleText + "'><p><span class='ui-icon ui-icon-help' style='float:left; margin: 10;'/>" + messageText + "</p>" ;
 
$( "#dialog" ).dialog( "destroy" );
 
$(content).dialog({ resizable: false , modal: true , buttons: { "Ok" : function () { return true ; }, "Cancel" : function () { $( this ).dialog( 'close' ); } } });

}

The dialog displays modally, and has all the parameter text, but I need to be able to get the dialog to return true or false to me so I know how to proceed. I am using the function like this in my code:

<

asp : Button ID ="okBtn" runat ="server" Text ="Ok" UseSubmitBehavior ="false" CssClass ="buttonDefaults" OnClientClick ="if(!ConfirmDialog('Confirm Withdraw', 'Are you sure you want to withdraw this application?')) return;" OnClick ="OnOkBtn_Click" />

I just downloaded all the jQuery UI code today and have both js files and the stylesheet plugged into my page, so I know I've got most of the functionality in play, but what am I missing?

Thanks!

John