473,626 Members | 3,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="dial ogHeight:600px; dialogWidth:850 px;resizable:ye s;center:yes"
LCV = window.showModa lDialog(aUrl,"" ,sFeatures);
alert(LCV);

}
</script>

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

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

parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;
alert(window.re turnValue);
}
</script>

<body onunload='onunl oadevent();'>
<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 8169
Hi,

try this:
<script>
function onunloadevent() {

window.returnVa lue = window.frames[0].aValue.innerTe xt;
alert(window.re turnValue);
}
</script>

I think you are supposed to alert(window.fr ames[0].aValue.innerTe xt) 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.c om>
??????:68****** *************** *****@posting.g oogle.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="dial ogHeight:600px; dialogWidth:850 px;resizable:ye s;center:yes"
LCV = window.showModa lDialog(aUrl,"" ,sFeatures);
alert(LCV);

}
</script>

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

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

parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;
alert(window.re turnValue);
}
</script>

<body onunload='onunl oadevent();'>
<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.r eturnValue = window.frames[0].aValue.innerTe xt;

-- bruce (sqlwork.com)


"Lee" <ro****@yahoo.c om> wrote in message
news:68******** *************** ***@posting.goo gle.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="dial ogHeight:600px; dialogWidth:850 px;resizable:ye s;center:yes"
LCV = window.showModa lDialog(aUrl,"" ,sFeatures);
alert(LCV);

}
</script>

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

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

parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;
alert(window.re turnValue);
}
</script>

<body onunload='onunl oadevent();'>
<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******* *******@TK2MSFT NGP12.phx.gbl>. ..
the following code will fail if the iframe is not the same domain as the
host frame

parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;

-- bruce (sqlwork.com)


"Lee" <ro****@yahoo.c om> wrote in message
news:68******** *************** ***@posting.goo gle.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="dial ogHeight:600px; dialogWidth:850 px;resizable:ye s;center:yes"
LCV = window.showModa lDialog(aUrl,"" ,sFeatures);
alert(LCV);

}
</script>

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

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

parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;
alert(window.re turnValue);
}
</script>

<body onunload='onunl oadevent();'>
<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.c om> wrote in message
news:68******** *************** ***@posting.goo gle.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="dial ogHeight:600px; dialogWidth:850 px;resizable:ye s;center:yes"
: LCV = window.showModa lDialog(aUrl,"" ,sFeatures);
: alert(LCV);
:
: }
: </script>
:
: Here is the iFrame:
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
: <html>
: <head>
: <title>Untitl ed Document</title>
: <meta http-equiv="Content-Type" content="text/html;
: charset=iso-8859-1">
:
: </head>
: <script>
: function onunloadevent() {
:
: parent.window.r eturnValue = window.frames[0].aValue.innerTe xt;
: alert(window.re turnValue);
: }
: </script>
:
: <body onunload='onunl oadevent();'>
: <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
6640
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 (not listed in the book errata on o'reilly website). Initially I get an error "window.dialogArguments.yourName" is null or not an object. Then I fill out the field on the form, press the button and the child window does display but there is no...
3
10352
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 window using a XUL page. Here is my question: despite seing examples of how to return a value to the caller window, I have been unable to make this work. Is there anyone who would have a TESTED very simple example on poping a modal
2
2723
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 have a list of values to click in the modal dialog box, and when they click on one of the values it closes the window and returns the value to the calling page. How would you do this in ASP.NET? thanks! (i need to use the value in the asp.net...
5
2486
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 the modal window with the new data the server creates a new, non-modal, window - leaving the modal window in the state it was and another, unrelated copy open with the requested data in it Can I get the data to return to the original modal window...
6
8142
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 selections to the server via a postback. How can I take these selections to the main page? Thanks
4
2149
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 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()
8
2904
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 of the modal window to make it work. I tried putting it both pages just to see if it would work and it doesn't seem to work. Does anyone know how to make these modal?
2
4497
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 boxes (please see associated source code below): 1) Win32 API with context ("btnWin32WithContext_Click") 2) .NET Framework with context ("btnFrameworkWithContext_Click") 3) Win32 API withOUT context ("btnWin32WithOUTContext_Click")
4
3753
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 returnValue = $find('mdlPopUpExt').show();
0
8205
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8644
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7206
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5579
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4094
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4208
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2632
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.