3 Replies - 2481 Views - Last Post: 12 February 2008 - 05:09 PM

#1 rjbzzr400  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-December 07

Passing details from a parent window to a popup

Posted 10 February 2008 - 01:08 PM

Hi, how do I pass details from a parent window onto a popup? I know of the window.opener syntax but I don't know how to use it.
All I need to do is take details from a textbox and dropdown box in the parent window and display them in a popup window.
I've looked all over the net but can't find exactly what I need to know.
Please help,
Thanks :)

This post has been edited by rjbzzr400: 11 February 2008 - 11:24 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Passing details from a parent window to a popup

#2 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Re: Passing details from a parent window to a popup

Posted 11 February 2008 - 03:25 PM

Hi
I think you don't want to use opener here
assuming your popup handler is myWindow
and in that window you have a text box with id ="myField"
try do ti this way
mywindow.document.getElementById('myField').value=my value"


Was This Post Helpful? 0
  • +
  • -

#3 rjbzzr400  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 11-December 07

Re: Passing details from a parent window to a popup

Posted 12 February 2008 - 03:14 AM

Thanks, is myWindow an example name for the parent window? Do I have to name it something?
And is it possible to get a value from a drop down box using an id tag?
Was This Post Helpful? 0
  • +
  • -

#4 ahmad_511  Icon User is offline

  • MSX
  • member icon

Reputation: 131
  • View blog
  • Posts: 722
  • Joined: 28-April 07

Re: Passing details from a parent window to a popup

Posted 12 February 2008 - 05:09 PM

Quote

assuming your popup handler is myWindow
and in that window you have a text box with id ="myField"

No myWindow is a variable handle the "open" method
something like when you say:

Quote

myVar=document.open( sUrl [ , sName ] [ , sFeatures ] [ , bReplace ] )

so it will control te pop up window when it's loaded

you can get or set anything (Iguess) since you have its handler
so you can do just like what you used to do with your parent document but with your pop up window handler to refer to which document you want to control
myPopup.document.getElementsById("test").innerHTML="Hello this is a test Message"


so above code is refers to an object has "test" as an id and it placed in your pop up window

I hope this helped you
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1