Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Urgent :: Return parameters from modal child window to parent window using javascript

Posted on 2005-05-13
8
Medium Priority
?
276 Views
Last Modified: 2008-03-10
I want  a way to Return parameters from modal child window to parent window using javascript

the modal window opened using (showModalDialog)

Please advice  ASAP

0
Comment
Question by:amr_swg
  • 4
6 Comments
 
LVL 9

Expert Comment

by:william007
ID: 14004428
Modal Parent Window(Opener.htm)
<html>
<head>
<script>
var a;
function openwindow(){
a=window.showModalDialog("open.htm",window);
document.getElementById("txt").value=a;
}
</script>
<head>
<body>
<input type="text" id="txt"/>
<input type="button" onclick="openwindow()" value="openDialog"/>
<input type="button" onclick="javascript:alert(a);"
value="showValue"/>
</body>
<html>

Modal Child Window(Open.htm)
<html>
<head>
<script>
function closeandsend(){
window.returnValue=document.getElementById("txt1").value;
window.close();
}
</script>
<head>
<body>
<input type="text" id="txt1"/>
<input type="button" onclick="closeandsend()" value="closeandsend">
</body>
<html>
0
 
LVL 9

Expert Comment

by:william007
ID: 14004434
By the way, COBOLdinosaur, thanks for your remind.
0
 
LVL 9

Expert Comment

by:william007
ID: 14005032
By the way, COBOLdinosaur, is it possible to remove your comment from the profile as I as unaware of this...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:william007
ID: 14006806
Very thanks, COBOLdinosaur, you are so considerate.
0
 

Author Comment

by:amr_swg
ID: 14203926
Dear all

The problem solved as follows

In parent window

window.showModalDialog('URL',self,'options');
 

in child window

<script>
opener = window.dialogArguments;
</script>

opener.document.getElementById('xx').value= val1
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 14240217
PAQed with points (500) refunded

DarthMod
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month10 days, 3 hours left to enroll

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question