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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

putting a value from a popup into a form

Status
Not open for further replies.

hame23

Programmer
Jul 20, 2006
3
GB
Hi

I have set up an online form for publishing a news item.

The form allows users to asssociate an image to the news article. These images are already uploaded into a directory of the site.

I have created a pop up box that lists all images in this directory and allows the user to preview them. However what I want to do is for the user to click on the images link on the popup and its value be added to a textfield on my form.

Is this possible with javascript. If so how would I go about achieving this?

Thanks very much i advance
 
you can try something like this (keeping in mind that you've given no technical information, so there is a lot of speculation):

Code:
function doThing(a) {
    var l = a.getElementsByTagName("img")[0].src;
    opener.formName.elementName.value = l;
}



<a href="#" onclick="doThing(this); return false;"><img src="..." /></a>



*cLFlaVA
----------------------------
[tt]( <P> <B>)13 * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top