Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


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

Posted on 2001-09-13
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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?

Industry Leaders: 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!


Accepted Solution

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

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>

function button1_onclick() {
     window.open("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

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

604 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