SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Adding text to parent window from child - what's wrong?

    I acutually want to add text to a hidden field, but I am using a text field for testing - if that makes a difference.
    Code:
    Page A
    
    <script>
    window.open('testB.htm', 'CtrlWindow', 'width=300,height=250,top=100,left=200,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
    </script>
    <form name="TestForm">
    	<input type="text" name="TestField" size="20" value="1 2 3">
    </form>
    
    
    Page B
    
    <script>
    	opener.window.documnet.TestForm.TestField.value = opener.window.documnet.TestForm.TestField.value + "4 5 6";
    </script>
    Thanks -
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  2. #2
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try the following.

    Code:
    Page B
    <script>
    	window.opener.document.TestForm.TestField.value += "4 5 6";
    </script>

  3. #3
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks - that did the trick.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •