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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Blue®

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



    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.


  • Heiko Krakau

    #2
    Re: Click link in popup window and insert link text in a field of mother window

    Hi Blue

    "Blue®" <mrblue@pd.jari ng.my> schrieb im Newsbeitrag
    news:bktbof$6j$ 1@news6.jaring. my...[color=blue]
    > 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[/color]
    into[color=blue]
    > the field?[/color]

    try this:

    function insertIntoOpene r(inStr)
    {
    window.opener.d ocument.forms[0].Category.value =inStr;
    window.close();
    }

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

    Heiko

    Comment

    • Blue®

      #3
      Re: Click link in popup window and insert link text in a field of mother window

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


      Comment

      • Heiko Krakau

        #4
        Re: Click link in popup window and insert link text in a field of mother window

        > I am not familiar with JS. Can you give me a clearer example, please?[color=blue]
        > Thanks.[/color]

        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="javas cript">
        function insertIntoOpene r(inStr)
        {
        window.opener.d ocument.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="Agricultu ral">Agricultur al</a></font></b></p>
        <blockquote>
        <p><u>Categorie s</u><br>
        <a href="javascrip t:insertIntoOpe ner('Cultivator ')">Cultivato r</a><br>
        <a href="javascrip t:insertIntoOpe ner('Plunger Pump')">Plunger Pump</a><br>
        <a href="javascrip t:insertIntoOpe ner('Brush Cutter')">Brush Cutter</a></p>
        </blockquote>
        [..]

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

        Hope it will help
        Heiko

        Comment

        • Blue®

          #5
          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.


          Comment

          Working...