I have simplified my code and changed the way the div for the dialog is populated (I now have the controller returning the view for the dialog to the external div). I still can't get the dang custom close button to work. The button has an id of "CloseMe", and its type is a button. I have read forum post after forum post and cannot figure out for the life of my why this doesnt work. I have:
- tried removing the conditional statement. it isnt the problem.
- added a dialog close button, which works just fine
- moved the dialog close and click event outside the dialog function- no dice
I must be missing something small here...
- $(function () {
$("#register-dialog").dialog({
autoOpen: false,
width: 500,
modal: true,
create: function (event, ui) {
$(".ui-dialog-titlebar", ui.dialog).hide();
},
open: function (event, ui) {
$("#CloseMe").click(function (event) {
$('register-dialog').dialog('close');
return false;
});
}
});
$('#RegisterBtn').click(function () {
var registerfrmbase = $("#register-frm-base");
if (registerfrmbase.valid()) {
$("#register-dialog").dialog("open");
}
});
});