Hello:
I am trying to use the opener property and it is giving me permission denied error
message:
This is the modify.html which is the new window and is trying to change the content
in the opener window.
<html>
<head><title>Link Help</title>
<script language="javascript">
function GetValue(form){
var addvalue = form.txtwebsite.value;
form.txtsetting.value=addvalue;
window.opener.testing.hello.value = addvalue;
}
</script>
</head>
<body>
<form name="f1">
Please enter the name of the web site here:<br>
<input type="text" name="txtwebsite" size="25">
<input type="text" name="txtsetting" size="25">
<center>
<input type="button" name="ok" value="OK" onclick="GetValue(this.form)">
</center>
</form>
</body>
</html>
The next file is the one which opens window and is called openwindow.html
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>Hello</TITLE>
<script language="javascript">
function openWindow(){
var props
'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=200,height=110';
var newWindow = window.open("modify.html", "addnewcode", props);
}
</script>
</HEAD>
<BODY>
<form name="testing">
<input type="text" name="hello"><br>
<input type="button" name="open" value="OpenWindow" onClick="openWindow()">
</form>
</BODY>
</HTML>
Do you see any problem in my code. I really need help on this one.
Thanks
Amardeep
Oleg Kapeljushnik wrote:
> Correct :).
> window.opener.formname.fieldname.value=textboxvalue;
> will do the job.
>
> -----Original Message-----
> From: Amardeep Kanwar [mailto:amardeep@h...]
> Sent: May 07, 2002 1:50 PM
> To: JavaScript HowTo
> Subject: [javascript_howto] RE: Passing Values Urgent
>
> Hi,
>
> I haven't used showModaldialog, what I have done is <a
> href="javascript:small_window(url)">click here</a>
> does the opener property work like this:
> window.opener.formname.fieldname.value=textboxvalue;
>
> Thanks for your help.
>
> Amardeep
>
> Oleg Kapeljushnik wrote:
>
> > You should use .opener property.
> >
> > This property refer you to the window who opened current window.
> > However, this property wont work if you open window using
> > showModaldialog.
> >
> > Oleg.
> >
> > -----Original Message-----
> > From: Amardeep Kanwar [mailto:amardeep@h...]
> > Sent: May 07, 2002 2:27 PM
> > To: JavaScript HowTo
> > Subject: [javascript_howto] Passing Values Urgent
> >
> > I have a form which opens another small window and what I want to do is to
> > pass the value from the small window to the form that opened it. How do i
> > do that.
> > Following is the code for the small window. I want to pass the value of
> > var addvalue to another form/window which opened the small window.
> > <html>
> > <head><title>Link Help</title>
> > <script language="javascript">
> > function GetValue(form){
> > var addvalue = form.txtwebsite.value;
> > }
> > </script>
> >
> > </head>
> > <body>
> > <form>
> > Please enter the name of the web site here:<br>
> > <input type="text" name="txtwebsite" size="25">
> > <center>
> > <input type="button" name="ok" value="OK" onclick="GetValue(this.form)">
> > </center>
> > </form>
> > </body>
> > </html>
> >
> > Can someone please help me. Its Urgent.
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> > http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> > r-20
> > Constructing Accessible Web Sites
> > http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> > r-20
> > Practical JavaScript for the Usable Web
> > http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> > r-20
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> > http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> > r-20
> > Constructing Accessible Web Sites
> > http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> > r-20
> > Practical JavaScript for the Usable Web
> > http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> > r-20
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20