Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Click link in popup window and insert link text in a field of mother window

Reply
Thread Tools

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

 
 
BlueŽ
Guest
Posts: n/a
 
      09-25-2003
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?

I have searched http://developer.irt.org/script/form.htm but could not find
anything related.

Thanks.


 
Reply With Quote
 
 
 
 
Heiko Krakau
Guest
Posts: n/a
 
      09-25-2003
Hi Blue

"BlueŽ" <> schrieb im Newsbeitrag
news:bktbof$6j$...
> 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

 
Reply With Quote
 
 
 
 
BlueŽ
Guest
Posts: n/a
 
      09-25-2003
I am not familiar with JS. Can you give me a clearer example, please?
Thanks.


 
Reply With Quote
 
Heiko Krakau
Guest
Posts: n/a
 
      09-25-2003
> I am not familiar with JS. Can you give me a clearer example, please?
> Thanks.


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')">C ultivator</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

 
Reply With Quote
 
BlueŽ
Guest
Posts: n/a
 
      09-27-2003
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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
HI STEPHANIE I WAS SO GLAD T6O TALKED TO YOUR MOTHER MOTHER'S DAY WEEK END. marie ore Computer Support 11 05-23-2006 09:02 PM
Is-it possible to write in a mother window from a child window ? orion30 Javascript 2 05-25-2005 06:11 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57