Moving value from popup Webform to main Webform?

Discussion in 'ASP .Net' started by =?Utf-8?B?Vk1J?=, Oct 9, 2006.

  1. How can I transfer some text from a Textbox in a popup window to the main
    webform that opened that popup?
    The popup webform will have some type of Button that the user will click in
    order to accept those changes. This is where the transter of the value should
    be. It could also be done when I close the popup form (whichever is easier).
    Once the popup form is closed, the value will then be used to fill a textbox
    in the main Form.
    I use VS2005 v2.0.

    Thanks.
     
    =?Utf-8?B?Vk1J?=, Oct 9, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?Vk1J?=

    GroupReader Guest

    1. pass a text box name (client-side name) from the main form to the
    popup form (in the url).
    2. the popup form gets a reference to it's "opener." Search for
    window.opener in google. Note: getting a reference to the opener
    could vary depending on browser type and the way the window is opened.
    See also showModalDialog.

    Example:
    <script type="text/javascript">
    var OpenerWindow = window.opener; // for when using window.open
    if (OpenerWindow == null) {
    OpenerWindow = window.dialogArguments; // for when using
    window.openModalDialog
    }
    </script>

    3. the popup form sets the text box in the parent form to a value
    window.opener.textboxname.value = 'hello';
    a) You can build this string dynamically in the code-behind - string
    together the command with the proper text box name.
    b) You can build this string dynamically in javascript using the
    javascript eval( ) command: eval( 'window.opener.' + textboxname +
    '.value') = 'hello'. Not sure on the syntax here, but it's something
    like that.
     
    GroupReader, Oct 9, 2006
    #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. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    473
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  2. =?Utf-8?B?Vk1J?=
    Replies:
    5
    Views:
    671
    GroupReader
    Oct 11, 2006
  3. linkswanted
    Replies:
    0
    Views:
    947
    linkswanted
    Dec 21, 2007
  4. William Starr Moake

    pass popup form value to main window

    William Starr Moake, Apr 29, 2004, in forum: Javascript
    Replies:
    1
    Views:
    113
    Csaba Gabor
    Apr 29, 2004
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    549
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page