Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Passing data from child window to parent window

Passing data from child window to parent window

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlhelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bishwambhar_sen
    wrote on last edited by
    #1

    Hi all, Let me first tell u wat I am trying to do.I have created a webpage with a button.On the click of that button(html control)I am opening a new window (as a popup).Now in this new child window I have some text boxes.I enter data in those textboxes and when I click a button,I want them to be sent to the parent window without the initial content of the parent window getting lost.Please suggest me a way to do so.I have been trying javascript but to no avail.Please help me out.:confused:

    G 1 Reply Last reply
    0
    • B bishwambhar_sen

      Hi all, Let me first tell u wat I am trying to do.I have created a webpage with a button.On the click of that button(html control)I am opening a new window (as a popup).Now in this new child window I have some text boxes.I enter data in those textboxes and when I click a button,I want them to be sent to the parent window without the initial content of the parent window getting lost.Please suggest me a way to do so.I have been trying javascript but to no avail.Please help me out.:confused:

      G Offline
      G Offline
      Greg Chelstowski
      wrote on last edited by
      #2

      in your popup window:

      function OnSomethingClick()
      {
      var el = window.opener.document.getElementById('SomeLabelOrOther');
      el.innerText = "Something else"; //obviously, you might want to change a different property

          window.close();// dont have to do that if you dont want to
      }
      

      This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.

      var question = (_2b || !(_2b));

      B 2 Replies Last reply
      0
      • G Greg Chelstowski

        in your popup window:

        function OnSomethingClick()
        {
        var el = window.opener.document.getElementById('SomeLabelOrOther');
        el.innerText = "Something else"; //obviously, you might want to change a different property

            window.close();// dont have to do that if you dont want to
        }
        

        This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.

        var question = (_2b || !(_2b));

        B Offline
        B Offline
        bishwambhar_sen
        wrote on last edited by
        #3

        Well thanx for helping me out.I m just gonna try this code.Anyways,can I try something like this?: el.innerText=document.getElementById('Something').value; It is because I need to pass a textbox value from child to parent.

        1 Reply Last reply
        0
        • G Greg Chelstowski

          in your popup window:

          function OnSomethingClick()
          {
          var el = window.opener.document.getElementById('SomeLabelOrOther');
          el.innerText = "Something else"; //obviously, you might want to change a different property

              window.close();// dont have to do that if you dont want to
          }
          

          This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.

          var question = (_2b || !(_2b));

          B Offline
          B Offline
          bishwambhar_sen
          wrote on last edited by
          #4

          Thanx for ur help...It works !!!

          B 1 Reply Last reply
          0
          • B bishwambhar_sen

            Thanx for ur help...It works !!!

            B Offline
            B Offline
            bishwambhar_sen
            wrote on last edited by
            #5

            Hi again, It is working on simple pages but it is not working when I use master pages.Seems to be a problem.Please help me out. I tried it without master pages and it was working fine,but when I am implementing it using master pages,it isnt working.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups