473,418 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

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>
Jul 19 '05 #1
5 8142
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>


Jul 19 '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>

Jul 19 '05 #3


If I move the iFrame to the same domain can the window it is calling
(src) be in another domain? I still have to figure a way to pull the
data back from the modal window in the other domain. Any thoughts?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4
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>

Jul 19 '05 #5
"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
Jul 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gretjns | last post by:
I'm trying to figure out this script doesn't display any text in the child window and why I'm getting the null or not an object error. It's taken directly from the Javascript and DHTML cookbook...
3
by: Smellyfrog | last post by:
Hi, I'm a newbie in mozilla web development. I've been developping apps for IE and Netscape for years though. After searching the internet (groups google etc..), I found a way to pop a modal...
2
by: Brian Henry | last post by:
If i have a window showing like this <script>window.showModalDialog('../weblinks/default.aspx','','unadorned:yes' );</script> how can i get it to return a value to its calling page? I want to...
5
by: CaptainZ | last post by:
When I open a modal window using 'showModalDialog' from an aspx page it works fine. But when I then perform a submit in my modal window to get data from the server, instead of the page returning to...
6
by: Mark Goldin | last post by:
I have main aspx page with a button that will show a modal dialog in the Browser when a user clicks on the button. On the modal form the user will do some selections. The he will submit his...
4
by: Lee | last post by:
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...
8
by: tshad | last post by:
I am using Andy Smiths Dialog windows, which work really well. My only problem is I am trying to make the Dialogs Modal. Someone mentioned putting <base target="_self"> into the head section...
2
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
4
by: Arnab das | last post by:
Below is the javascript code i am using function confirmDelete() { var returnValue = window.confirm("Deleting the current page. Continue?"); return returnValue; // var...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.