SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Submit from child to parent window not working

    Hey guys,

    I have a script that opens a popup window (that runs through a wizard) and I need the final page to close the child and target the parent. Sounds easy enough, but it's not working in Netscape6.x.

    I named my parent (window.name = 'main' and I target it in the child. This works fine in IE and NS4, but doesn't work in NS6. Is this not a W3C compliant solution and therefore not supported by NS6?

    Can anyone think of a way to target window.opener or maybe use some other DOM method to get my child form to target its parent in NS6?

    Someone will have a solution. I can feel it
    Thanks,

    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To refer back to the parent window you would use the "opener" property. For instance if you want to run a function in the parent window from the child you would do this:
    opener.func_name()

    or to populate a form field:
    opener.document.form_name.field_name.value="some Value"

    or a variable:
    opener.variable_name="some value"

    Hope that helps.

  3. #3
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, requestcode. I understand how to access and change DOM objects from the opener. Neither of these do me any good in my current problem, though.

    I need to be able to submit a form from the child to the parent. You can't specify <FORM TARGET="window.opener"> that's mixing metaphors, so to speak Again, this should be solved by giving the parent a name and targetting that name. In further testing, I'm getting mixed results. Sometimes it works in NS6, sometimes it doesn't. I need to try to identify what causes it not to work occassionaly, and fix that.

    If anyone has any ideas, please let me know.
    thanks,
    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  4. #4
    SitePoint Member
    Join Date
    Jan 2002
    Location
    Sri Lanka
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Just a suggestion

    I kow that tis post was put up some time ago and you probably found a solution. However here is my two cents.

    Why cant you call a function on the parent form that will submit the parent form (pass any variables you want to the parent through function) then close the child form.

    Doesnt this achive the result you want ?


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
  •