473,657 Members | 2,554 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.val ue = text.

<HTML>
<SCRIPT TYPE='text/javascript' LANGUAGE='Javas cript'>
function foo(text) {opener.documen t.myForm.URL.va lue = text;}
</SCRIPT>

<BODY> <Form>
<input type='button' value='Fill Text' onclick='foo("H ello 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 6440
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.val ue = text.

<HTML>
<SCRIPT TYPE='text/javascript' LANGUAGE='Javas cript'>
function foo(text) {opener.documen t.myForm.URL.va lue = text;}
</SCRIPT>

<BODY> <Form>
<input type='button' value='Fill Text' onclick='foo("H ello 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
3806
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
22187
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 to do is have a control in the parent browser window which can store the class_id and the...
2
23497
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
11566
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 out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
3
2589
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 number based on a table value that I retrieve + 1. i.e. Parent record field value = 1 Children record...
1
1955
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 master window launches the children, and maintains an associative array to keep track of each one....
2
2744
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 the parent to be aware of the child and vice-versa.
1
3592
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% not fill the parent window. I have given my example codes, please give a solution as soon as...
4
3972
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 complaine I was using the lesser than symbol.
0
8392
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7321
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4151
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1950
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1607
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.