Passing values from textbox to popup window...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikas1111
    New Member
    • Feb 2008
    • 122

    Passing values from textbox to popup window...

    Hi All.
    I want to pass values from textbox to pop-up window. How Can i do that? Can anyone pls help me ? I Have created a popup window..
    Last edited by vikas1111; Apr 15 '08, 08:37 AM. Reason: Title change..
  • vikas1111
    New Member
    • Feb 2008
    • 122

    #2
    can anybody help me ?

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Show your code so we have a better idea of how and where you want this code.

      Should the values be passed from the parent, or do you want it to access them from the popup?

      Comment

      • vikas1111
        New Member
        • Feb 2008
        • 122

        #4
        Originally posted by acoder
        Show your code so we have a better idea of how and where you want this code.

        Should the values be passed from the parent, or do you want it to access them from the popup?
        Hi
        Thanks for reply.. I have done with passing the value from parent,, now i want to access values from the popup....

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Use window.opener to refer to the parent. From there, you can access the textbox using its ID, e.g.
          [code=javascript]window.opener.d ocument.getElem entById("textbo xID").value[/code]

          Comment

          • vikas1111
            New Member
            • Feb 2008
            • 122

            #6
            Originally posted by acoder
            Use window.opener to refer to the parent. From there, you can access the textbox using its ID, e.g.
            [code=javascript]window.opener.d ocument.getElem entById("textbo xID").value[/code]

            Hi
            I tried it but the values from the text box are not retrieved..
            Here is how i have written the code

            Code:
             
             var abc= window.opener.document.getElementById("txtbox").value; 
                    document.write(abc);

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              You can't use document.write after the page has loaded, otherwise you're re-opening the document for writing.

              If you're trying to write it to the page, access a div on the page and set it's innerHTML instead.

              Comment

              Working...