passing values between child and parent windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neena
    New Member
    • Aug 2006
    • 17

    passing values between child and parent windows

    Hi
    I am uing C#.net & using javacript for a popup window.

    I've a form and there is a button named Categories. When it is clicked, it will open a new window for the selection of categories.
    When the categories are selected from ListBox ,and the submit button of the popup window is clicked, the category id value should be set in the parent form and the popup window will close.

    the problem is that the parent window form doesn't get the value of the selected listbox item of popup window.

    Anyone plz help me out.
  • neena
    New Member
    • Aug 2006
    • 17

    #2
    passing values between child and parent windows

    anyone please tell me how to pass the selected value from a listbox in popup window(child window) to a textbox in parent window

    please help me...i am new in javascript

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Assuming:
      Mainform is the form name in the main window,
      Name_field is the text box where the value must be placed,
      ChildForm is the form name in the child window,
      Name_field is the name of the select group:
      [HTML]opener.document .forms["Mainform"].Name_field.val ue =
      ChildForm.Name_ field.options[ChildForm.Name_ field.selectedI ndex].value[/HTML]

      Ronald :cool:

      Comment

      • neena
        New Member
        • Aug 2006
        • 17

        #4
        Thank u Ronald for replying.its working now.But how will i get the values to the listbox from database.If its server control then its ok.But in javascript how will we get the values?

        Please reply

        Neena

        Originally posted by ronverdonk
        Assuming:
        Mainform is the form name in the main window,
        Name_field is the text box where the value must be placed,
        ChildForm is the form name in the child window,
        Name_field is the name of the select group:
        [HTML]opener.document .forms["Mainform"].Name_field.val ue =
        ChildForm.Name_ field.options[ChildForm.Name_ field.selectedI ndex].value[/HTML]

        Ronald :cool:

        Comment

        • Annaleria
          New Member
          • Jul 2006
          • 1

          #5
          I'm afraid that the basic answer is you can't. Javascript cannot communicate with server side databases.

          Comment

          Working...