Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    simple variable inclusion question

    I say 'simple' but oh, what it is to be so close - but not yet arrived. !
    So much is about getting the question right. And I have been working on this one for quite a few days now.

    So, i have worked out how to pass my variable to the popup.

    var VARIABLE = name;

    How do I get the VARIABLE into the line:

    function put(a,val) { var insert = window.opener.document.EDITFORM.VARIABLE; insert.value += a + val; }

    I have tried +, () \'\' and a variety of approaches but can't seem to crack it.

    Great would be my delight to have this last leg of the journey resolved.

    thanks - arfa

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,467
    Thanks
    3
    Thanked 495 Times in 482 Posts
    Code:
    <html>
    
    <head>
      <title></title>
    <script language="JavaScript" type="text/javascript">
    /*<![CDATA[*/
    function Recieve(txt){
    
     document.Show.Show1.value=txt;
    
    }
    /*]]>*/
    </script></head>
    
    <body>
    <span onclick="window.open('pu109.htm');">Link</span>
    <script> vic=0; </script>
    <form name=Show id=Show style="position:absolute;visibility:visible;top:450px;left:0px;" >
    <input size=10 name=Show0 >
    <input size=10 name=Show1 >
    <input size=10 name=Show2 >
    <input size=10 name=Show3 >
    <input size=10 name=Show4 >
    <input size=10 name=Show5 >
    <input size=10 name=Show6 >
    <input size=10 name=Show7 >
    <input size=10 name=Show8 >
    <input size=10 name=Show9 >
    </form>
    </body>
    
    </html>

    Code:
    <html>
    
    <head>
      <title></title>
    </head>
    
    <body>
    <br />
    <span onclick="window.opener.Recieve('vic');">send 'vic'</span>
    
    </body>
    
    </html>
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    72
    Thanks
    3
    Thanked 0 Times in 0 Posts

    slow and steady

    thanks vic,

    Plz excuse my lack of js skills but it is not clear to me which is the parent window and which the popup.

    nor what you are setting up.

    I will study further off-line but any further clarification would be most helpful

    thanks

  • #4
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,467
    Thanks
    3
    Thanked 495 Times in 482 Posts
    the parent page contains

    function Recieve(txt){

    the popup page

    <span onclick="window.opener.Recieve('vic');">send 'vic'</span>

    sends text string 'vic' to parent page function Recieve

    which displays the text in Show.Show1 input.
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •