It seems that you're using SimpleModal class for custom dialogs. The first thing you should notice is that it doesn't have close
method. However it has hide
method which does the job.
But hide
method cannot be called on global SimpleModal
class, it should be called on instance (that's your SM
variable). So you can modify your code like following:
window.SM = new SimpleModal({"hideHeader":true,"closeButton":false,"hideFooter":true,"offsetLeft":dlgx, "offsetTop":dlgy });
var form_check = null;
SM.show({
"model":"modal",
"title":"Title, or empty?",
"contents":"<iframe src='booking.iframe.php' id='booking_iframe' scrolling='no' /></iframe>"
});
Now you have global variable SM
with current dialog instance, and now you can call its methods from <iframe>
without any problems like this:
<a onclick="parent.SM.hide()">Close</a>