Popup window sending info to main window

In a main window I have various form fields. To populate some of those fields I want to generate a popup window that will have a list of hyperlinks generated from an SQL Statement.

When the user clicks on the link, I want the information associated with that link to populate some of the form fields in the main window.

Does someone know how to do this? I have seen lots of code to populate a popup window but no code to populate the main window from the popup.

Thanks.


Comments

  • : In a main window I have various form fields. To populate some of those fields I want to generate a popup window that will have a list of hyperlinks generated from an SQL Statement.
    :
    : When the user clicks on the link, I want the information associated with that link to populate some of the form fields in the main window.
    :
    : Does someone know how to do this? I have seen lots of code to populate a popup window but no code to populate the main window from the popup.
    :
    : Thanks.
    :
    :
    :

    Hi there,

    Yep, try using the WINDOW.OPENER object. It's a direct reference to the window which opened your popup window.

    From here, window.opener.top.document.myForm.formElement.value = "whatever"; will allow you to populate the main window's form elements!

    Hope this helps!
    Bradley q;)
  • : : In a main window I have various form fields. To populate some of those fields I want to generate a popup window that will have a list of hyperlinks generated from an SQL Statement.
    : :
    : : When the user clicks on the link, I want the information associated with that link to populate some of the form fields in the main window.
    : :
    : : Does someone know how to do this? I have seen lots of code to populate a popup window but no code to populate the main window from the popup.
    : :
    : : Thanks.
    : :
    : :
    : :
    :
    : Hi there,
    :
    : Yep, try using the WINDOW.OPENER object. It's a direct reference to the window which opened your popup window.
    :
    : From here, window.opener.top.document.myForm.formElement.value = "whatever"; will allow you to populate the main window's form elements!
    :
    : Hope this helps!
    : Bradley q;)
    :

    An almost perfect answer, only leave out the top. (If you are in a frame, the link to open the window will be in the same frame as the form you want to update by clicking the popups hyperlink, if not so: use the "top" but follow it with a reference to the frame the form is in!)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion