adomsg
asked on
Closing pop up window and pass the selected data back to parent page
I now v a parent page that will pop up a window when user clicks a command button. The pop up page allows user to select some data and when user click select these command button, all the selected data will display on the parent screen.. I just need 2 know the way 2 close the pop up window and the parent page will automatically display the selected data from the pop up window...
Thanks
Thanks
When your popup form selection is submitted you could either directly update parent form elements or (if selection causes many updates in a parent form) submit popup form, save selection in database and return to this popup javascript directive to submit parent form (or just reload) in order to let it re-read data from DB and close popup window.
1.
function onSelection()
{
opener.document.forms[0].s omefields. value = window.document.forms[0].m yselection .value;
window.close();
}
2.
function onLoad()
{
opener.document.forms[0].s ubmit();
// or opener.location.href = opener.location.href;
window.close();
}
1.
function onSelection()
{
opener.document.forms[0].s
window.close();
}
2.
function onLoad()
{
opener.document.forms[0].s
// or opener.location.href = opener.location.href;
window.close();
}
ASKER
when do i call these functions?? And where do i put them
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
adomsg,
I think if you use HTML button control instead of ASP server button control to popup new window it won't cause any server side postback. then popup page like follows -
<INPUT class="expButton" id="btnpopNewWin" onclick="javascript:window .open('frm popNewwin. aspx,'POPU P','width= 500,height =600,scree nX=900,scr eenY=800,l eft=500,to p=100')"ty pe="button " value="Select" Height="22" Width="81">
where POPUP ="SesVar" will be some page scope string variable to be used as session variable name in parent page
in Child popup window while submitting the information put the info in local array and then
Session.Add("SesVar", arrOfPopChilddata)
now you can easily access the data using session variable POPUP as session(POPUP).
I think it'll work for you .... isn't it ?
Jyoti.
I think if you use HTML button control instead of ASP server button control to popup new window it won't cause any server side postback. then popup page like follows -
<INPUT class="expButton" id="btnpopNewWin" onclick="javascript:window
where POPUP ="SesVar" will be some page scope string variable to be used as session variable name in parent page
in Child popup window while submitting the information put the info in local array and then
Session.Add("SesVar", arrOfPopChilddata)
now you can easily access the data using session variable POPUP as session(POPUP).
I think it'll work for you .... isn't it ?
Jyoti.
ASKER