473,503 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New window.name value doesn't stick. Old value returns unless the window is refreshed

Hi there,

I'm having some difficulty in renaming a window object. I'm opening
the window in question via a targetted submit:

<!-- CODE EXCERPT FROM WINDOW 1 -->
<form target="newWin">

Based on certain criteria, I sometimes need to close window 1 and have
window 2 take its name:

<!-- CODE EXCERPT FROM WINDOW 2 (currently named "newWin" -->
var strWindowName = opener.name;
opener.name = null;
opener.close();
//Ensure the window doesn't hold onto the instance
opener = null;

//Rename the window
window.name = strWindowName;
top.name = strWindowName;

While an alert at the end of my function indicates that the renaming
has been successful, when I submit the form on window 2 I find that
the window name has reverted to "newWin". For some reason however,
refreshing the window makes the correct (previous opener) name stick.

I'm fairly baffled by this behavior, so any help would be so very
appreciated!

Thanks!

Diana
Jul 23 '05 #1
1 1746
Just in case anyone else has this problem, after much experimentation
I was able to resolve my issue by revising the window.name value
immediately before submitting my form. This seemed to trick the form
into opening a new window rather than resubmitting into my existing,
newly renamed window.

What a headache. I'm guessing this is a bug with my version of IE or
with Javascript itself.
Jul 23 '05 #2

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

Similar topics

10
14677
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to...
2
33773
by: Seth E Seligman | last post by:
I'm working on a web based file manager. The rename file function creates a new window with a form allowing the user to enter a new file name. Before the form gets submitted, I want to make sure that...
6
4063
by: TheKeith | last post by:
I am doing a form for my site and would like to enable and disable a radio button set depending on whether one of the choices on an outer radio button set is checked. How can I refer to all the...
1
2151
by: sentinel | last post by:
Hello, I'm having problems refreshing a main window, and am not sure really whether the solution will be Javascript or PHP related. Firstly, I have a main file that calls a pop-up box which...
4
9642
by: Phil Powell | last post by:
I thought this would work but it seems to not work neither in Netscape nor in IE: <script type="text/javascript"> <!-- // OBTAINED FROM http://www.javascripter.net/faq/settinga.htm //...
26
5634
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
18
3300
by: len.hartley | last post by:
Hi, I am trying to pop-up a window when the user clicks on an image. The problem is that when the user clicks on the image and the window pops up OK, but the window underneath also proceeds to...
8
9383
by: Jason S | last post by:
Hi, is there any way of getting my VB (6.0) program to automatically 'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE...
5
8275
by: Tom Gur | last post by:
Hi, I was wondering how do I get control over a window (Win32). to be more specific, I need to find a handle to a window of a certain program and minimize the window.
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
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,...
1
7011
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...
0
5596
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,...
0
3180
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...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
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 ...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
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...

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.