473,513 Members | 3,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to fill some field in parent window from a child window

I need to write asp/script/html code to fill the following function.
1. When a page appA.mycom.com/aa.html (aa.html code shown below) is visited
from my site, a user can click the button "Launch", which launches a new
window with a page from a different domain, say appB.mycom.com/bb.html. In
the form myForm of aa.html, there is a field called URL.

<html> <body>

<form name="myForm">
<input type="button" value="Launch" onclick="window.open('bb.html')">
<input type="text" name="URL" value="Nothing Here Initially">
</form>

</body></html>

2. At bb.html (code shown below), there is a button "Fill Text", once
clicked, I want some text from bb.html to be filled in the URL field of
myForm in aa.html via opener.document.myForm.URL.value = text.

<HTML>
<SCRIPT TYPE='text/javascript' LANGUAGE='Javascript'>
function foo(text) {opener.document.myForm.URL.value = text;}
</SCRIPT>

<BODY> <Form>
<input type='button' value='Fill Text' onclick='foo("Hello world ")'>
</Form> </BODY>
</HTML>

The problem is that when I clicked the button "Fill Text" on bb.html, I got
an error: access denied. This reminds me sth fundamental. That is, do I have
to implement this from server side? Thanks.

__________________________________________________ _______________
Instant message during games with MSN Messenger 6.0. Download it now FREE!
http://msnmessenger-download.com

Jul 20 '05 #1
1 6429
Well, I am too lazy to try this out ... but, I believe if put this
javascript statement:

document.domain = "mycom.com";

in both the "opener" and the "opened" window, you will eliminate the
access denied error.

On Fri, 26 Sep 2003 10:58:15 -0400, "Song Zhang" <so****@hotmail.com>
wrote:
I need to write asp/script/html code to fill the following function.
1. When a page appA.mycom.com/aa.html (aa.html code shown below) is visited
from my site, a user can click the button "Launch", which launches a new
window with a page from a different domain, say appB.mycom.com/bb.html. In
the form myForm of aa.html, there is a field called URL.

<html> <body>

<form name="myForm">
<input type="button" value="Launch" onclick="window.open('bb.html')">
<input type="text" name="URL" value="Nothing Here Initially">
</form>

</body></html>

2. At bb.html (code shown below), there is a button "Fill Text", once
clicked, I want some text from bb.html to be filled in the URL field of
myForm in aa.html via opener.document.myForm.URL.value = text.

<HTML>
<SCRIPT TYPE='text/javascript' LANGUAGE='Javascript'>
function foo(text) {opener.document.myForm.URL.value = text;}
</SCRIPT>

<BODY> <Form>
<input type='button' value='Fill Text' onclick='foo("Hello world ")'>
</Form> </BODY>
</HTML>

The problem is that when I clicked the button "Fill Text" on bb.html, I got
an error: access denied. This reminds me sth fundamental. That is, do I have
to implement this from server side? Thanks.

_________________________________________________ ________________
Instant message during games with MSN Messenger 6.0. Download it now FREE!
http://msnmessenger-download.com


Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3790
by: Bostonasian | last post by:
I am trying to append options to dropdown in parent window from option items in child window. In parent window, I have following code: <script language="javascript"> function AddItem2DropDown(item){ exists = false; for(d=0;d<drpDwn.length;d++){ if(drpDwn.options.value == item.value)
4
22158
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want...
2
23479
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
1
11537
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all...
3
2572
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table) and children form (table). Relationship equals one to many. I'd like to auto number the fields accordingly and traditionaly I assign a unique...
1
1949
by: Bill Borg | last post by:
Hello all, Simple chat app, where the site owner has a master window with all requests for chat, status of each room, etc., and child windows for each separate chat in which the owner is engaged. When the owner closes one of his child windows, I want to update the master window. I understand "reasonably" well how to go about this. The...
2
2737
by: epaetz | last post by:
Is there a way to decouple the linkage between a parent and a child window? Does the parent window have any sort of a collection that holds all the children that it has spawned? I want to break that connection from the parent side or the child side, it doesn't matter as long as the communication link is completely broken. I don't want...
1
3583
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100%...
4
3965
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and the first child window closes after opening the second child. This is the second time I am typing the post, I lost all content because the site...
0
7269
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7559
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7123
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5701
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4756
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3248
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.