javascript_objects thread: window.opener.document.frm_name.txt_name.value not working
this kind of error comes only if the files are in two different
domains.. else it should not.. but it may some times...good luck..
-----Original Message-----
From: Parul Agarwal [mailto:parul.agarwal@e...]
Sent: Monday, January 13, 2003 2:16 PM
To: JavaScript Objects
Subject: [javascript_objects] Re:
window.opener.document.frm_name.txt_name.value not working
Thanks Yoganarasimha G. It is working, even the previous code works
sometimes in IE5.0, but sometimes it gives the error "Access denied"
with
the same settings.
-----Original Message-----
From: Yoganarasimha G [mailto:yoganarasimha.g@m...]
Sent: Monday, January 13, 2003 2:16 PM
To: JavaScript Objects
Subject: [javascript_objects] Re:
window.opener.document.frm_name.txt_name.value not working
Hi all
here's the simple code which is doing ur task..
just modify this to ur need, this is tested in IE 6
<! --- Parent window code start -->
<HTML>
<BODY>
<script language=3D"javascript">
function create() {
window.open('passingValues.html','childwindow');
}
</script>
<form name=3D"parent1">
<br>
<a href=3D"javascript:create();">Open child</a>
<input type=3D"text" name=3D"testParent" value=3D"Parent window"
id=3D"testParent">
</form>
</BODY>
</HTML>
<! --- Parent window code end -->
<! --- Child window code start -->
<HTML>
<head></head>
<BODY onLoad=3D"fillValues()">
<script language=3D"javascript">
function fillValues()
{
document.child1.childText.value =3D
window.opener.document.parent1.testParent.value;
alert(document.child1.chieldText.value);
//return false;
}
</script>
<form name=3D"chield1">
<input type=3D"text" name=3D"chieldText">
</form>
</BODY>
</HTML>
<! --- Child window code end -->
-----Original Message-----
From: Rashmi [mailto:parul.agarwal@e...]
Sent: Monday, January 13, 2003 1:20 PM
To: JavaScript Objects
Subject: [javascript_objects] Re:
window.opener.document.frm_name.txt_name.value not working
Both the files are on the same server and more over in the same
directory. Both are very simple HTML files. Following is the code for
the parent window. The code for child window is already known to you.
<HTML>
<script language =3D javascript>
function winOpen(i)
{
if (i =3D=3D 1)
document.parent_frm_name.txt_name.value =3D
document.parent_frm_name.txt_name1.value
else
document.parent_frm_name.txt_name.value =3D
document.parent_frm_name.txt_name2.value
var hTop =3D (screen.availHeight - 250)/2;
var hLeft =3D (screen.availWidth - 500 )/2;
str =3D "toolbar=3Dno, scrollbars =3Dno;top=3D200px; left=3D" + hLeft
+ ";
width=3D500; height =3D 250"
window.open("child.html", "child_window", str)
}
</script>
<BODY onLoad =3D fillValues() >
<form name =3D parent_frm_name method =3D post>
<input type =3D hidden name =3D txt_name>
<input type =3D text name =3D txt_name1 id =3D txt_name value =3D
name1>
<input type =3D button name =3D btn_update id =3D btn_update
onClick =3D winOpen(1)>
<input type =3D text name =3D txt_name2 id =3D txt_name value =3D
name2>
<input type =3D button name =3D btn_update id =3D btn_update
onClick =3D winOpen(2)>
</form>
</BODY>
</HTML>
Anyway thanks for looking into the matter.
> Not sure why this is happening then, can we see a bit more code, the
window.open command for instance. The only time I've seen this when both
windows existed and were in the same domain was where two protocols were
used or relative versus absolute addressing.
Joe
----- Original Message -----
From: "Rashmi" <parul.agarwal@e...>
To: "JavaScript Objects" <javascript_objects@p...>
Sent: Monday, January 13, 2003 7:16 AM
Subject: [javascript_objects] Re:
window.opener.document.frm_name.txt_name.value not working
> Yes both the files are on the same server.
> Thanks
>
>
> > Are both documents from the same server?
> Joe
> ----- Original Message -----
> From: "Parul Agarwal" <parul.agarwal@e...>
> To: "JavaScript Objects" <javascript_objects@p...>
> Sent: Monday, January 13, 2003 6:38 AM
> Subject: [javascript_objects]
> window.opener.document.frm_name.txt_name.value
> not working
>
>
> > I want to pass some values from the parent window to the child
window.
> So
> > in the onLoad() function of the child window, I try to fill the
textbox
> with
> > the value of the textbox in the parent window.
> > eg
> >
> > <HTML>
> > <script language =3D javascript>
> > function fillValues()
> > {
> > document.child_frm_name.txt_name.value =3D
> > window.opener.document.parent_frm_name.txt_name.value
> > }
> > </script>
> > <BODY onLoad =3D fillValues() >
> > <form name =3D child_frm_name method =3D post>
> > <input type =3D text name =3D txt_name id =3D txt_name>
> > </form>
> > </BODY>
> > </HTML>
> >
> > But I get an error message in the function fillValues() "Access
denied".
> >
> > Can anybody help me? Any help would be appreciated.
> >
> > --
> >
> >
> > "This e-mail message may contain confidential, proprietary or
legally
> privileged information. It
> > should not be used by anyone who is not the original intended
recipient.
> If you have erroneously
> > received this message, please delete it immediately and notify the
> sender.
> The recipient
> > acknowledges that ICICI Bank or its subsidiaries and associated
> companies,
> (collectively "ICICI
> > Group"), are unable to exercise control or ensure or guarantee the
> integrity of/over the contents of the information contained in e-mail
> transmissions and further acknowledges that any views
> > expressed in this message are those of the individual sender and no
> binding nature of the message shall be implied or assumed unless the
sender
> does so expressly with due authority of ICICI Group.Before opening any
> attachments please check them for viruses and defects."
> >
> >
> >
> >
> >
>
--
"This e-mail message may contain confidential, proprietary or legally
privileged information. It
should not be used by anyone who is not the original intended recipient.
If you have erroneously
received this message, please delete it immediately and notify the
sender. The recipient
acknowledges that ICICI Bank or its subsidiaries and associated
companies, (collectively "ICICI
Group"), are unable to exercise control or ensure or guarantee the
integrity of/over the contents of the information contained in e-mail
transmissions and further acknowledges that any views
expressed in this message are those of the individual sender and no
binding nature of the message shall be implied or assumed unless the
sender does so expressly with due authority of ICICI Group.Before
opening any attachments please check them for viruses and defects."