How to pass values from a child window to the parent window with the parent window being refreshed.

Posted on 2001-09-13
Last Modified: 2010-05-18
Hi friends,

Iam working on a ERP project.Iam to pass certain values to a pop up window where certain back end process goes on,
once the submit button is clicked I need to

1.Pass the values back to the parent window
2.The pop window should close
3.The parent window should get refreshed.

Iam using asp , javascript and VBscript.


Question by:kala21

Expert Comment

ID: 6481507
hai kala,

        i think you can refer to the parent window(window that opened another window) using window.parent(please check the syntax).

   so when u click the submit button in the new window,
   pass all the values to javascript and use the following

window.current.close(check syntax).
window.parent.href =


LVL 10

Expert Comment

ID: 6486813
you probably need to use window.opener and not window.parent.

the easiest way to pass parameters back to the parent would be to implement a jscript function in the parent something like:

function myFunc(par1, par2)

then do the following once the submit button is pressed:

function onSubmitClicked
window.opener.myFuc(par1, par2);
LVL 15

Expert Comment

ID: 6488783
prasanna_be_eee, please read the EE guidelines on proposing answers - in this case you should have posted a comment.

kala21, please feel free to reject the proposed answer if it does not completely solve your problem.

When the submit button is pressed, is any kind of script on the server called?

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Accepted Solution

elisch earned 100 total points
ID: 6500540
Use this code in the start page:

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>

function button1_onclick() {"child.htm", "child", null, "height=200,width=400, resizable=no, status=no,toolbar=no,menubar=no,location=no");

<INPUT type="text" id=text1 name=text1>
<P><INPUT id=button1 name=button1 type=button value=Button LANGUAGE=javascript onclick="return button1_onclick()"></P>

Use this code in the window that opens:

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>

function button1_onclick() {
     var winOpener = window.opener;
     winOpener.text1.value = "test value";

<INPUT type="button" value="Set Textbox Value In Opener" id=button1 name=button1 LANGUAGE=javascript onclick="return button1_onclick()">


You can modify it as necessary to pass values back and forth.



Expert Comment

ID: 6515700

The possible solutions for your questions are:
1) You can use
  opener.document.<field name>.value= <some value>;
3) opener.document.location.reload();

All the best,

Expert Comment

ID: 6727992
This question is LOCKED with a Proposed Answer.  If it helps you, great, accept it and grade it to close.  If not, reject it and comment as to why or what else is needed.

Few additional experts will join this collaboration effort, once a question has been locked.  Just want to confirm this to you.  If more than one expert helps you, you can always split points or award additional help in a new question, within the same topic area.  If you need help from us, post a zero point question here, and include the link:

Community Support Moderator @ Experts Exchange

P.S.  Double click your Member Profile, expand VIEW HISTORY to navigate and update all your open questions please.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 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