Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.opener is not working in netscape

Status
Not open for further replies.

glendsj

IS-IT--Management
Jul 26, 2001
26
0
0
US
This code works in IE but not netscape. Often times it's a syntax problem that netscape does not like.

The onchange event updates a table and then tells the parent to update also, then it closes the pop up.
Any ideas why this won't work in netscape? I tied it in 4.77 and 6.1

code follows:

<script Language=&quot;JavaScript&quot;>
<!--
function updateParent(form){
var i = &quot;&quot;;
i = form.selOTFdesc.selectedIndex;
opener.document.budform.OtherDesc_code.value = form.selOTFdesc.options(i).value;
form.submit();
opener.document.budform.submit();
}

function OnloadCloseCheck(form){
//if close check is true close the window
var Ccode = form.CloseCode.value;
if (Ccode == &quot;T&quot;) {window.close();}
}
//-->
</script>
 
Could you post the html that you are using in your document?

Also the standard way to open a new window is window.open(...parameters...);
===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
not sure why you think I was opening a window.
The parent window is already open. adding window. does nothing. netscape just won't perform the window.opener
 
What do you mean by window.opener? ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
Ok nevermind I get what your saying.

What version of Netscape do you want it to work in?

You are using the IE DOM to reffer to all the forms and things on the page --
===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
instead of reffering to an object like this:

form.selOTFdesc.selectedIndex;

refer to it like this:

document.getElementById(form).selOTFdesc.selectedIndex;

That will work in IE 5+ and Netscape 6+.

The same goes with the document.opener --

opener.document.getElementById(budform).submit(); ===
Supports Mozilla and Web Standards
Knows HTML/XHTML, CSS1, JavaScript, PHP, C++, DOM1
===
 
hie
but glendsj, u opened this window, didnt u? so, when u open a new window (from wich u'll use window.opener 2 access this window) set this new window's opener handy:

var w=window.open(...)
w.opener=top

i think this shuld work.. Victor
 
thanks for all of the support.
netscape just does not want to let me do this.

i open a popup from the parent.

the code above is in the pop up.

I update a database table from the popup with the form.submit ( form being a variable that contains this.form)

then i also set the contents of a hidden field with the value of the selected index.
then I submit the parent form

an onload event in the popup closes the pop window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top