Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 24th, 2006, 03:08 PM
Registered User
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing value to new window

I'm new to Javascript and I want to pass values from my window to a new window. The new window was not programmed by me and it is already on the Web, so I cannot add/edit the code content of the Web page. The codes that I have on my window are below:

    var NewWindow
        function openNewWindow() {
            NewWindow = window.open("http://www.webexample.com","NEW","resizable=yes");
My window's form is called "Form1" and the child window's form is called "EditForm". I have an ASP textbox called "Value" that I want to pass to the child window's textbox called "ValueDisplay" (Not an ASP textbox but an input type=text tag). The following codes is from the parent window to pass my value to the child's window value.

    function test() {
        NewWindow.opener.NewWindow.EditForm.ValueDisplay.value = document.getElementById("Value").value;
I keep get an access denied or permission denied error statement when I click the error message in the status bar.
Old August 28th, 2006, 03:29 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

By default you can't communicate across windows from different domains. You maybe able to change the settings in the security section for the zone the page is in, "Allow data source access across domains", but I've had mixed results in the past with this and it would mean changing all the users' settings who ran the page.
The restriction is in place to stop unwanted access to another page, e.g you are logged onto your bank account as well as a phishing site at the same time.


Joe (Microsoft MVP - XML)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Centering Popup window & Blur Parent window jkusmanto Javascript How-To 0 May 25th, 2007 03:19 AM
passing session to a popup window konsama JSP Basics 0 April 17th, 2007 04:22 AM
Passing data from modal dialog to window. ganga Javascript 1 September 26th, 2006 06:45 AM
Window.Open not passing argument in ASP.NET whiterainbow Javascript How-To 2 May 10th, 2005 04:03 AM
Passing value across iframe and pop-up window muklee Javascript 1 October 28th, 2004 04:44 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.