Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pass >1 variable and value to window opener from popup?

Status
Not open for further replies.

Coder7

Programmer
Oct 29, 2002
224
US
Good afternoon.

I'm need to pass an additional variable value to the window opener and I don't know the syntax to pass >1 variable.

Currently (passing 1 value):

window.opener.document.frmCommentsList.hNeedToRefresh.value=true;

I need to also pass:
hDelete.value=true

I appreciate your assistance, as always.
Thank you.
 
Correction: the window is not a popup

:(
 
1 array = 1 variable, yet curiously, 1 array may contain many elements... 8) I've had to use this technique when I've been restricted to passing one variable to a function or whatnot. The downside is that the function usually isn't smart enough to just know what to do with the array, so you have to add programming on that end to bust it up.

What, exactly, are you trying to do?

Cheers,

Edward "Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!" -- inventor of the cat door
 
Firstly - are you saying this works? I can't imagine... Oh well, no doubt someone better than me will point out the error of my ways. I do tend to go for what I see as simple solutions,... If I can think of one...

Sorry - my usual approach.

If the new window's html is:

<html>
<head>

<title>New Window</title>
<script language=&quot;JavaScript&quot;>

function retvals()
{
opener.returnvals.retvals.value=document.invals.invals0.value;//call the opener's form and textbox - can be any container - can it?
opener.returnvals.retvals1.value=document.invals.invals1.value;
return;
}

</script>
</head>
<body>
<form name=&quot;invals&quot;>
<input type=&quot;textbox&quot; name=&quot;invals0&quot;>
<input type=&quot;textbox2&quot; name=&quot;invals1&quot;>
<input type=&quot;button&quot; onClick=&quot;javascript:retvals();&quot; value=&quot;Submit&quot;>
</form>
</body>
</html>

and opening window is:

<html>
<head>
<!---->
<title>opener</title>
<script language=&quot;JavaScript&quot;>

function openwin()
{
window.open('newwin.htm','newwin');
return;
}

</script>
</head>
<body onLoad=&quot;javascript:eek:penwin();&quot;>
<form name=&quot;returnvals&quot;>
<input type=&quot;textbox&quot; name=&quot;retvals&quot;></input>
<input type=&quot;textbox&quot; name=&quot;retvals1&quot;></input>
</form>
</body>
</html>

all is fine and dandy.

Copy the html to a text editor and save as .htm to test.

Blah blah whatever, whatever.

Andy%-)
 
Edward,

I want to pass two hidden values from the destination window to the source window. Currently I am passing one variable (hNeedToRefresh per my script above - and this works great).

I'm having a paging problem that I think I can solve if I specify when I've performed a physical delete on the database and I'd specify a delete action by passing hDelete.value=true from the destination window to the source window. Then, on the asp page for the source window, I'd check if hDelete=true and, if yes, I make objRs.AbsolutePage = objRs.PageCount which I believe will solve the paging problem.

Thanks for your time and help. I really appreciate it.
 
simply add one more statement:

window.opener.document.frmCommentsList.hNeedToRefresh.value=true;
window.opener.document.frmCommentsListhDelete.value=true;



=========================================================
if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top