Hi,
You should be able to close the dialog by referencing it by the 'this' keyword.
i.e.:
$(this).dialog('close');
Can you try changing your dialog close function to use:
$("#popupdiv").dialog({
title: 'Registration',
width: 650,
height: 450,
modal: true,
buttons:{
OK:function(){
$(this).dialog('close');
}
}
});
[EDIT]
If you are having trouble closing the dialog using the this keyword, or the original selector used to create the dialog (both of which should work), you can try the following approach:
var popup = $("#popupdiv").dialog({
title: 'Registration',
width: 650,
height: 450,
modal: true,
buttons:{
OK:function(){
closeDialog();
}
}
});
function closeDialog(){
$(popup).dialog("close");
}
The above is not an elegant example, closing via the 'this' keyword is what you should be doing ... but it's worth mentioning as an option.
If neither of the above get you going again, then it would appear you have larger issues. As starting point, I would review your versions of jQuery, and jQueryUI
[/EDIT]
... hope it helps.