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

Discussion in 'Javascript' started by Blue®, Sep 25, 2003.

  1. Blue®

    Blue® Guest

    Blue®, Sep 25, 2003
    #1
    1. Advertising

  2. Blue®

    Heiko Krakau Guest

    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
     
    Heiko Krakau, Sep 25, 2003
    #2
    1. Advertising

  3. Blue®

    Blue® Guest

    I am not familiar with JS. Can you give me a clearer example, please?
    Thanks.
     
    Blue®, Sep 25, 2003
    #3
  4. Blue®

    Heiko Krakau Guest

    > 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')">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
     
    Heiko Krakau, Sep 25, 2003
    #4
  5. Blue®

    Blue® Guest

    Not working

    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.
     
    Blue®, Sep 27, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sebastien
    Replies:
    1
    Views:
    553
    Michael Borgwardt
    Nov 7, 2003
  2. VisionSet

    Mother of a Refactor

    VisionSet, Jul 31, 2006, in forum: Java
    Replies:
    11
    Views:
    617
    Luke Webber
    Aug 1, 2006
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    552
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    232
    Dr John Stockton
    Aug 12, 2004
  5. orion30
    Replies:
    2
    Views:
    123
    Thomas 'PointedEars' Lahn
    May 25, 2005
Loading...

Share This Page