Detecting sender / focused element in sender?

J

jodleren

Hi

I want to open a window using JS, when a button is pressed. In the new
window I'd like to check for which button was pressed.
For cetain reasons, I'd like not to have that in the URL.

What I have is

function whatever(input)
{
win3=window.open("myfile.php?dir=" +
encodeURIComponent(input),"dm_popup","width=500,height=550,scrollbars=yes,resizable=yes");
return false;
}

and <p><input name="btn_sel1" type="button" value="..."
onclick="OpenRootDirSel(textbox1.value);">&nbsp;&nbsp;</p>

And here I'd like to add btn2 and textbox2 - which should work the
same way.
The point is, that the new window uses JS too to set the value of the
related textbox.

Any ideas?

WBR
Sonnich
 
J

Joost Diepenmaat

jodleren said:
Hi

I want to open a window using JS, when a button is pressed. In the new
window I'd like to check for which button was pressed.
For cetain reasons, I'd like not to have that in the URL.

Set it in the opener window:

window.name_of_button = whatever;

then from the new window do:

name_of_button = window.opener.name_of_button;

http://developer.mozilla.org/en/docs/DOM:window.opener

AFAIK this only works for windows that have been opened via window.new()

Joost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top