Firstly Hi, first post here but have been reading the site for a while now.
Im having a small issue when trying to use a modeless window, which then inturn includes an iframe to display a series of html files and frames.
Firstly my Calling page
Code:
<html>
<head>
<title>Help Call Test</title>
<meta name="generator" content="textpad 4.6">
</head>
<body>
<script>
var sUserName="";
var sLink="http://localhost/1000001/UK/main.html";
var sTitle="Knowledge Base - ";
var sDialog="dialogWidth:850px; dialogHeight:600px; center:yes; scroll:no; status:yes; help:no; adorned:yes";
var sForced="Y";
function showCUWindow(){
cu_showModalDialog('http://localhost/1000001/UK/main.html','Help - ','dialogWidth:850px; dialogHeight:600px; center:yes; scroll:no; status:no; help:no');
}
function cu_showModalDialog(link, windowName, dialogProperties)
{
sForced.value = document.all.comp.value
showModelessDialog("../kbwrap2.htm",window,dialogProperties);
}
function fnUpdate()
{
oComments.innerText = sComments;
oComplete.innerText = sComplete;
comments.value = sComments;
}
</script>
<body onload="javascript:onClick=showCUWindow();">
<input type=hidden name=link value="">
<input type=hidden name=title value="">
<input type=hidden ID=comments value="">
<input type=hidden ID=complete value="">
<input type=hidden ID=comp value="Y">
<P>Comments: <SPAN ID="oComments"
STYLE="color:red;font-size:12">....</SPAN></P>
<P>Completed? : <SPAN ID="oComplete"
STYLE="color:red;font-size:12">....</SPAN>
</body>
</html>
This in turn calls my wrap file which displays the stored url in the iframe.
Code:
<html>
<HEAD>
<TITLE>Knowledge Base</TITLE>
<SCRIPT language="javascript">
var returned = "";
/* -------------------------------------------------------------
This function makes use of the dialogArguments property of the
window object. dialogArguments allows the global variable sUserName
to feed the value supplied to the input in this dialog box back to
the window that called it.
---------------------------------------------------------------- */
function fnGetInfo()
{
var sData = dialogArguments;
document.all.oEnterComments.value = oComment.value;
sData.sComments = oEnterComments.value;
sData.sComplete = complete.value;
sData.fnUpdate();
}
/* Initial function to get the details where they schould be */
function doInit() {
var sData = dialogArguments;
// if (window.dialogArguments != null)
//{
document.title = sData.sTitle;
cu_post.action = sData.sLink;
cu_post.submit();
//}
// else
//{
// alert("No arguments found for dialog");
//}
}
/* Cancel runs when the agent tries to close the window from the top right */
function doCancel()
{
if(document.all.complete.value == "N")
{
event.returnValue = 'Closing the troubleshoot before completion will result in a failed compliance.';
fnGetInfo();
return false;
}
else
{
fnGetInfo();
window.close();
}
}
function doReturn()
{
document.all.complete.value = "Y";
doCancel();
}
// -->
</SCRIPT>
</head>
<body onload='doInit()' topmargin='0' leftmargin='0' onbeforeunload="doCancel()">
<form name="cu_post" action="http://localhost/cu/some_url" method='post' target="kbwrap">
</form>
<iframe name="kbwrap" topmargin='0' leftmargin='0' height="80%" width="100%" scrolling="auto"></iframe>
<table><tr><td >
<textarea name="oComment" cols="80" rows="5"></textarea>
<input name="Close" type="button" value="Close" onClick="doReturn()">
<input name="returned" type="hidden" value="">
<input ID=complete type="hidden" value="N">
<INPUT ID=oEnterComments type="hidden">
<INPUT ID="oReturned" cols="80" rows="5">
</td></tr></table>
</body>
</html>
Now my problem is when i try and send some details from the Iframe back to the wrapper html, to then inturn send onto to the calling page. I can send back from the wrapper to the calling page no problem but cant get any details out of the iframe, and get a permission denied.
All the iframe does is on a completion tries to do
if(top.returned){
top.returned.value = "Returned" ;
}
And ive tried all types of references to get back to the tagin the wrapper.
Can anyone help me?
Kazz