accessing dialog button after it's open?

accessing dialog button after it's open?


Hi,
I'd like to disable a button in my dialog after the dialog is opened.
IE, if the user does something specific in my dialog, I want to disable
the visible Cancel button. I've tried this to get at the Cancel button:
var myDialog = $("#dialogArea").dialog( {
autoOpen:false,
title:"Edit",
modal: true,
height:400,
width:525,
overlay: {
opacity: 0.5,
background: "black"
},
buttons: {
"Cancel": function() {
$(this).dialog("close");
}
} // buttons
}); // dialog
$(myDialog).dialog("open");
... user does some stuff in the open dialog, then I run this to try to
disable the Cancel button:
$(myDialog).data("buttons.dialog.Cancel").attr("disabled","disabled");
Using Firebug, I found that the button has no ID or name, so I'm trying
to figure out how to get a reference to it. Ideas?
Thanks,
Jack