Results 1 to 5 of 5

Thread: simple variable inclusion question

  1. #1
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Huh? It sounds like VARIABLE is a form element from what you're trying to do there. Do you mean the variable contains the name of the form element, like this:
    function put(a,val) { var insert = window.opener.document.forms['EDITFORM'].elements[window.opener['VARIABLE']]; insert.value += a + val; }
    ?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think this might be approaching the solution. Several posts on several forums seem to be heading this way.

    But... currently it won't work.
    I will make up a sample scenario - test it in isolation - and post back.

    Many thanks for your help.

  4. #4
    Join Date
    Jul 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, right on track.

    What I have boiled it down to:

    function put(a, val, name) {
    window.opener.document.EDITFORM.elements[name].value += (a + val);
    }

    Thanks for your guidance.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You mean
    Code:
    window.opener.document.forms.EDITFORM.elements[name].value += (a + val);
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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