I use a jQuery UI dialog that is made from HTML supplied from server. Code:
$("<div id='pastedial'>" + result.htmlPasteDialog + "</div>").dialog({
maxHeight: "85%",
minWidth: 700,
modal: true,
buttons: {
Cancel: function () {
// do cancel
},
"Paste!": function () {
// do action
}
// some other config
});
}
To dialog elements I attach event handler that validates the dialog. This works well. The validation function is just another function of page, that addresses dialog items based on their IDs that I know directly.
How I can address dialog's buttons from external function (that belongs to page) so I can disable actions if dialog is not validated?
Thanks in advance!