Link to home
Start Free TrialLog in
Avatar of kala21
kala21

asked on

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

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.


Bye

kala
Avatar of prasanna_be_eee
prasanna_be_eee

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 =
         "parent_window_url?var1="+val1+"var2="+val2;

 

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)
{
 doWhateverYouWantHere()
}

then do the following once the submit button is pressed:

function onSubmitClicked
{
window.opener.myFuc(par1, par2);
window.opener.href="whatEverURL";
window.close();
}
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?

Ant
ASKER CERTIFIED SOLUTION
Avatar of elisch
elisch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi,

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

All the best,
Chakree
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:

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Moondancer
Community Support Moderator @ Experts Exchange

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