Setting values on parent form

Discussion in 'Javascript' started by jodleren, Feb 14, 2007.

  1. jodleren

    jodleren Guest

    Hi all!

    I know how to reload the mainform, but accessing a form and setting a
    value there?

    onLoad="if (window.opener && !window.opener.closed)
    { window.opener.forms[0].elements[0].value='xxx';window.close(); }"><?

    BR
    Sonnich
    jodleren, Feb 14, 2007
    #1
    1. Advertising

  2. jodleren

    jodleren Guest

    On Feb 14, 9:47 pm, "jodleren" <> wrote:
    > Hi all!
    >
    > I know how to reload the mainform, but accessing a form and setting a
    > value there?


    Played a bit around and came up with this:

    function PostSelection(input)
    {
    if (window.opener && !window.opener.closed)
    {
    window.opener.document.forms[0].picture.value=input;
    window.close();
    }
    else
    alert("Parent window has been closed!");
    }


    BR
    Sonnich
    jodleren, Feb 14, 2007
    #2
    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. Jim in Arizona
    Replies:
    4
    Views:
    7,951
    Jim in Arizona
    Aug 24, 2005
  2. Mark Rae
    Replies:
    3
    Views:
    824
  3. VbUser25
    Replies:
    1
    Views:
    137
    Evertjan.
    Feb 9, 2005
  4. Replies:
    3
    Views:
    162
    Michael Winter
    Nov 8, 2004
  5. Replies:
    1
    Views:
    90
    LÅ‘rinczy Zsigmond
    Dec 9, 2004
Loading...

Share This Page