can I close the dialog javascript after submited the data in the dialog( form in the dialog was load on different page),.
sory my english is bad, this is the script.
$(document).ready(function () {
$('a#href').live('click', function (e) {
e.preventDefault();
var page = $(this).attr("href")
var pagetitle = $(this).attr("title")
var $dialog = $('<div></div>')
//var $dialog = $(window.parent.document.getElementById('modal'))
.html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
//.html(page)
.dialog({
autoOpen: false,
modal: true,
height: 550,
width: 700,
title: pagetitle
});
$dialog.dialog('open');
});
});
html :
<a id="href" title="Form Upload Dokumen BAUK / BAUF" href="upload_bauk_r2b.php?project_id=<?php echo $project_id; ?>"></a>
If the iFrame is coming from the same domain, what I assume since you only use a filename and not a whole domain to reference
upload_bauk_r2b.php, then it should be possible to access the iFrame from the parent document (where your current script lies within).So you could programatically (with Javascript) produce a “close”-Button in the iFrame and then bind the destruction of the modal popup to that close-Button. I am not expert when it comes to jQuery, but I guess you would bind the event similarly as you bound the ‘click’-Event on that -Link.
Another hint: Why using iFrames anyway? Couldn’t you just load the content of that modal popup dynamically over AJAX?