JQuery - iFrame in div dialog
>> Parent Window: Main.aspx
function showStoreLocation(type)
{
var _url = "getStoreLocation.aspx?type=" + type;
var _iframe = '<iframe src=\'' + _url + '\' width="100%" height="100%" frameBorder="0" style="margin:0px;padding:0px;" scrolling="yes" id="iframe" name="iframe"></iframe>';
$(document).ready(function() {
$("#dialog").dialog({
modal: true,
height: 500,
width: 350,
title: 'STORE LOCATION',
close: function () { $("#TextBoxStoreLocation").focus(); }
});
$("#dialog").html(_iframe).dialog("open");
});
}
>> iFram File: getStoreLocation.aspx
Javascript Code:
//Send the value to the TextBoxStoreLocation in parent window (Main.aspx)
parent.$("#TextBoxStoreLocation").val(code);
//close dialog
parent.$("#dialog").dialog("close");
function showStoreLocation(type)
{
var _url = "getStoreLocation.aspx?type=" + type;
var _iframe = '<iframe src=\'' + _url + '\' width="100%" height="100%" frameBorder="0" style="margin:0px;padding:0px;" scrolling="yes" id="iframe" name="iframe"></iframe>';
$(document).ready(function() {
$("#dialog").dialog({
modal: true,
height: 500,
width: 350,
title: 'STORE LOCATION',
close: function () { $("#TextBoxStoreLocation").focus(); }
});
$("#dialog").html(_iframe).dialog("open");
});
}
>> iFram File: getStoreLocation.aspx
Javascript Code:
//Send the value to the TextBoxStoreLocation in parent window (Main.aspx)
parent.$("#TextBoxStoreLocation").val(code);
//close dialog
parent.$("#dialog").dialog("close");