473,473 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Detecting sender / focused element in sender?

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,he ight=550,scrollbars=yes,resizable=yes");
return false;
}

and <p><input name="btn_sel1" type="button" value="..."
onclick="OpenRootDirSel(textbox1.value);">&nbsp;&n bsp;</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
Jan 29 '08 #1
2 4410
jodleren <so*****@hot.eewrites:
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.
Jan 29 '08 #2
Joost Diepenmaat wrote:
[...]
name_of_button = window.opener.name_of_button;
var ... = ...

And the `opener' property should be tested if it still refers to an open
Window object. See the FAQ.
http://developer.mozilla.org/en/docs/DOM:window.opener

AFAIK this only works for windows that have been opened via window.new()
You would be correct if you meant window.open().
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jan 31 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Albanese | last post by:
I am trying to build a user control that will allow a user to select a date from a calendar. I have to code that will run on the calendar's SelectionChanged event, but i am at a loss to return the...
22
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to...
9
by: Bijoy Naick | last post by:
I've implemented forms authentication and authorization on my application. In my Web.Config, my authorization section looks like this.. <authorization> <allow roles="admin" /> <deny users="*"...
27
by: Deek | last post by:
I have a target(graphic) that moves via, i am trying to detect a hit of the target with and essay(copied below) my prof gave us, but I am not sure what to do, if you could get me going in the...
6
by: jcrouse | last post by:
I have the following mouse events assigned to a label control. Is the a way I can tell which mouse button the users has clicked with? Private Sub lblP1JoyUp_Click(ByVal sender As System.Object,...
7
by: Wayne Wengert | last post by:
I am using VB with a Windows NET application. I have a datagrid in which the user can add rows using the "*" row. I want to detect whenever the user has added a row. I found the following code at...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
2
by: James | last post by:
Hi. I'm probably attempting the impossible but what the hey. I'm modifying a multi-paneled form which has 8 different listviews, To allow sorting by columns I've had to add a diffrerent handler...
5
by: kh | last post by:
My app filters windows messages because of some custom window functionality I have implemented. Does my window receive a message when the user selects Alt-Tab? If so which message? Many thanks ...
1
by: nayana4u | last post by:
I want to take the id of the focused element in the page by javascript. but with my situation i cant use the onFouse() method of each element to call other javascript element. simply without...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.