Click link in popup window and insert link text in a field of mother window

H

Heiko Krakau

Hi Blue

Blue® said:
http://asianmachinetrader.com/dbase/add.htm

For the "Category" field in the page above, is it possible to click on the
category (in the "Show me" popup window) and have the category inserted into
the field?

try this:

function insertIntoOpener(inStr)
{
window.opener.document.forms[0].Category.value=inStr;
window.close();
}

where inStr is obviously the value you want to insert into the textbox

Heiko
 
H

Heiko Krakau

I am not familiar with JS. Can you give me a clearer example, please?

the following is the start of your categories.htm on
http://asianmachinetrader.com/dbase/add.htm. I added the function from my
last posting:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>AMT: Possible Machine Categories</title>
<script language="javascript">
function insertIntoOpener(inStr)
{
window.opener.document.forms[0].Category.value=inStr;
window.close();
}
</script>
</head>
[..]

Then you have to change your list of possible categories like in the
following snipplet:

[..]
<a name="Agricultural">Agricultural</a></font></b></p>
<blockquote>
<p><u>Categories</u><br>
<a href="javascript:insertIntoOpener('Cultivator')">Cultivator</a><br>
<a href="javascript:insertIntoOpener('Plunger Pump')">Plunger Pump</a><br>
<a href="javascript:insertIntoOpener('Brush Cutter')">Brush Cutter</a></p>
</blockquote>
[..]

If you do that for your whole list it will work.

Hope it will help
Heiko
 
B

Blue®

I tested that and it is not working. Please note that the category list is
on a popup new page. Clicking the link will insert the category into the
Category field of the mother page.

I have tested putting the JS link in the mother page and popup page - both
didn't work. Can help further. Appreciate.
 

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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top