[Javascript] how do I know which buttom opened my pop window?

Sabrina Leandro saleandro at yahoo.com
Mon Sep 16 09:51:34 CDT 2002


Hi all,

I have a page to update information about images. Each
image has its source, size, link, etc. I have a popup
window to change the image source and link. Each image
has its button that opens this popup window. 

I generate the form via PHP, reading the info about
the images from a database. So my forms elements are
named like this: "name_of_the_element"+image_number.
So I have name_of_the_element1, name_of_the_element2
and so on. 

My problem is that I want to know which button from
which image was clicked to open the popup window, so I
can update the right form element. Does someone know
how can I do that?

Also, can I do something like this in JavaScript:
   
var name_variable = 'document.formname.elementname' +
number;

and then access name_variable.value?
which would be document.formname.elementname1 or 2 or
according to whichever image was selected?

I hope I could make myself clear :)
If not, ask me and I´ll try to be more specific.

Thanks in advance!
Sabrina


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com



More information about the Javascript mailing list