469,283 Members | 2,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

Modal window and the return value

Lee
I am using a modal window and an iFrame to try and pull a return value
back. I am doing this across domains.

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.

I call the modal window and wait for the return as such:
function LCC()
{
var aUrl = "http://.../IFrame.html";
sFeatures="dialogHeight:600px;dialogWidth:850px;re sizable:yes;center:yes"
LCV = window.showModalDialog(aUrl,"",sFeatures);
alert(LCV);

}
</script>

Here is the iFrame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

</head>
<script>
function onunloadevent(){

parent.window.returnValue = window.frames[0].aValue.innerText;
alert(window.returnValue);
}
</script>

<body onunload='onunloadevent();'>
<TABLE align='left' border='0'>
<TR>
<TD align='center'><IFRAME frameborder='0'id="Frame1"
src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
MARGIN=0" SCROLLING="no" ></IFRAME></TD>
</TR>
</table>
</body>
</html>
Nov 18 '05 #1
4 1959
Hi,

try this:
<script>
function onunloadevent(){

window.returnValue = window.frames[0].aValue.innerText;
alert(window.returnValue);
}
</script>

I think you are supposed to alert(window.frames[0].aValue.innerText) first
to find out if you have got its value.
--
Juno
MCSD.NET, MCDBA, MCSE
----------------------------------------------------------
Support Team of EasyDotNet, INC. http://www.EasyDotNet.com
DataForm.NET - The most powerful data entry web server control for ASP.NET
"Lee" <ro****@yahoo.com>
??????:68**************************@posting.google .com...
I am using a modal window and an iFrame to try and pull a return value
back. I am doing this across domains.

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.

I call the modal window and wait for the return as such:
function LCC()
{
var aUrl = "http://.../IFrame.html";
sFeatures="dialogHeight:600px;dialogWidth:850px;re sizable:yes;center:yes"
LCV = window.showModalDialog(aUrl,"",sFeatures);
alert(LCV);

}
</script>

Here is the iFrame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

</head>
<script>
function onunloadevent(){

parent.window.returnValue = window.frames[0].aValue.innerText;
alert(window.returnValue);
}
</script>

<body onunload='onunloadevent();'>
<TABLE align='left' border='0'>
<TR>
<TD align='center'><IFRAME frameborder='0'id="Frame1"
src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
MARGIN=0" SCROLLING="no" ></IFRAME></TD>
</TR>
</table>
</body>
</html>


Nov 18 '05 #2
the following code will fail if the iframe is not the same domain as the
host frame

parent.window.returnValue = window.frames[0].aValue.innerText;

-- bruce (sqlwork.com)


"Lee" <ro****@yahoo.com> wrote in message
news:68**************************@posting.google.c om...
I am using a modal window and an iFrame to try and pull a return value
back. I am doing this across domains.

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.

I call the modal window and wait for the return as such:
function LCC()
{
var aUrl = "http://.../IFrame.html";
sFeatures="dialogHeight:600px;dialogWidth:850px;re sizable:yes;center:yes"
LCV = window.showModalDialog(aUrl,"",sFeatures);
alert(LCV);

}
</script>

Here is the iFrame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

</head>
<script>
function onunloadevent(){

parent.window.returnValue = window.frames[0].aValue.innerText;
alert(window.returnValue);
}
</script>

<body onunload='onunloadevent();'>
<TABLE align='left' border='0'>
<TR>
<TD align='center'><IFRAME frameborder='0'id="Frame1"
src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
MARGIN=0" SCROLLING="no" ></IFRAME></TD>
</TR>
</table>
</body>
</html>

Nov 18 '05 #3
Lee
How do I return values from another domain. I have to call out to
this other domain to run the ASP pages. Then pass them back to the
parent window. I would really like to use the modal window because it
functions just like I would want it to. I tried moving the iFrame to
the parent domain but then recieved a permission denied error.

Any thoughts?

"bruce barker" <no***********@safeco.com> wrote in message news:<#C**************@TK2MSFTNGP12.phx.gbl>...
the following code will fail if the iframe is not the same domain as the
host frame

parent.window.returnValue = window.frames[0].aValue.innerText;

-- bruce (sqlwork.com)


"Lee" <ro****@yahoo.com> wrote in message
news:68**************************@posting.google.c om...
I am using a modal window and an iFrame to try and pull a return value
back. I am doing this across domains.

I have the value returned from the modal window to the iFrame window
but I can not get the value returned to the parent window. The alert
in the parent window always returns undefined errors. Any help would
be much appreciated.

I call the modal window and wait for the return as such:
function LCC()
{
var aUrl = "http://.../IFrame.html";
sFeatures="dialogHeight:600px;dialogWidth:850px;re sizable:yes;center:yes"
LCV = window.showModalDialog(aUrl,"",sFeatures);
alert(LCV);

}
</script>

Here is the iFrame:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">

</head>
<script>
function onunloadevent(){

parent.window.returnValue = window.frames[0].aValue.innerText;
alert(window.returnValue);
}
</script>

<body onunload='onunloadevent();'>
<TABLE align='left' border='0'>
<TR>
<TD align='center'><IFRAME frameborder='0'id="Frame1"
src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
MARGIN=0" SCROLLING="no" ></IFRAME></TD>
</TR>
</table>
</body>
</html>

Nov 18 '05 #4
"Lee" <ro****@yahoo.com> wrote in message
news:68**************************@posting.google.c om...
: I am using a modal window and an iFrame to try and pull a return value
: back. I am doing this across domains.
:
: I have the value returned from the modal window to the iFrame window
: but I can not get the value returned to the parent window. The alert
: in the parent window always returns undefined errors. Any help would
: be much appreciated.
:
: I call the modal window and wait for the return as such:
: function LCC()
: {
: var aUrl = "http://.../IFrame.html";
: sFeatures="dialogHeight:600px;dialogWidth:850px;re sizable:yes;center:yes"
: LCV = window.showModalDialog(aUrl,"",sFeatures);
: alert(LCV);
:
: }
: </script>
:
: Here is the iFrame:
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
: <html>
: <head>
: <title>Untitled Document</title>
: <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
:
: </head>
: <script>
: function onunloadevent(){
:
: parent.window.returnValue = window.frames[0].aValue.innerText;
: alert(window.returnValue);
: }
: </script>
:
: <body onunload='onunloadevent();'>
: <TABLE align='left' border='0'>
: <TR>
: <TD align='center'><IFRAME frameborder='0'id="Frame1"
: src="http://...../default.asp" Style="HEIGHT: 10in; WIDTH: 10in;
: MARGIN=0" SCROLLING="no" ></IFRAME></TD>
: </TR>
: </table>
: </body>
: </html>

Lee... You might get more help in a different group. Loading an .asp file
in an iframe doesn't require asp coding. You've sent this message to two
groups which conflict with each other. This also does not appear to be a
..NET app. Perhaps an HTML or J(ava)script group might be more beneficial to
you.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Smellyfrog | last post: by
2 posts views Thread by Brian Henry | last post: by
5 posts views Thread by CaptainZ | last post: by
6 posts views Thread by Mark Goldin | last post: by
8 posts views Thread by tshad | last post: by
2 posts views Thread by =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post: by
4 posts views Thread by Arnab das | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.