473,654 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

post form to window opener

I am trying to get a popup window to work for editing notes in my
application. Here's how I implemented it:

The original frame is called ORIGINALFRAME and contains a link like
this:

<a href="javascrip t:launchwin();" >Edit Note</a>
function launchwin() {
// ... custom stuff
newNoteWindow = window.open(str URL,'NoteWindow ',strOptions);
if(newNoteWindo w.opener == null) {
newNoteWindow.o pener = self;
}
if (window.focus) {
newNoteWindow.f ocus();
}
}

In the resulting pop-up window, I have a POST form whose onSubmit
handler contains these lines:

document.forms[0].target=window. opener.name; // becomes ORIGINALFRAME
document.forms[0].submit();
window.close();

I am passing the URL of the ORIGINALFRAME as a query string parameter
to the pop-up window. In the page that handles the form submission, it
reads this parameter and redirects to it after processing the form.
This way, the original frame appears to reload, and it only reloads
after the form is completely processed.

The implementation doesn't work in either IE or Firefox when there is
more than one original frame with the same name in multiple windows.
In Firefox, the post is directed to the first original frame, while in
IE, it doesn't seem to do anything.

The POST form is in the pop-up window. Does anyone know how to set its
target to the opener, reliably?

Jul 23 '05 #1
1 5251
To solve this, instead of changing the target of the form to the
opener, I could instead post directly to the self window (the pop-up
window). Then I use some javascript in the form response to refresh
the opener and close the window, like this:

' Form Handler (In ASP) - Show a javascript page to
' refresh the opener and close the pop-up window
%><html><head>
<script type="text/javascript">
function CloseWindow() {
window.opener.l ocation.href='< %=RedirectURL%> ';
window.close();
}
</script>
</head><body
onload="CloseWi ndow();"></body></html><%
Response.End

But this is not the most elegant solution...

Jul 23 '05 #2

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

Similar topics

7
12431
by: Marco Alting | last post by:
Hi, I want to use the submit button of a new window to submit the form of the new window (which carries two values to the opener window) and then submit the opener form. Can anyone tell me how to do this?
18
1709
by: q2005 | last post by:
Hi, all When I do as the following, it becomes a GET action to the the server. How do I make it as a POST action? That means I don't want the string after "?" show on URL bar and, to the server, it can follow POST function to get the data passed in. Thank you very much! window.open("../../Server.php?"+xsValue, "", zNONHTML_STYLE);
0
1838
by: Prescott | last post by:
I want to execute a javascript function that will set a value in the parent window from the child widow where its called and then post the form to the server. I seem to be able to execute one or the other but not both. The child page (html) code is: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="AddKeyWord.aspx.vb" Inherits="ComponentSearch.AddKeyWord"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML>...
2
1201
by: Boonaap | last post by:
I have this pop-up window with a calendar and a listbox all the dates i selected appear in this listbox, and are put in an array How can i pass this array from this pop-up to the main form anyone ?
3
5394
by: cindy | last post by:
I have a web form “Form1” with a panel. Inside the panel is a datalist. One of the items displays the field value “xyz” from the dataset. If the field is null the user clicks on a javascript to let him pick a value for the field from a popup modal window. <td><a href="javascript:GetNet()"> <img src="”> </a>VPN Network:</td> <% if (XYZ !=""){%> <td><asp:TextBox id="txtXYZ" runat="server" Text='<%#...
2
3865
by: gialby | last post by:
Ciao i have this problem.... i have a main asp page with this code PARENT PAGE <script language="vbScript"> function ricerca() finestra=window.open("ricerca.asp","","width=500,height=500,top=0,left=0,resizable=yes,scrollbars=yes")
4
6139
by: jojowebdev | last post by:
I see how the window.opener works, pretty neat in that the pop window knows the parent. Is there a property that also knows the form field parent? My function does not know which of the 3 select menus called it. What can I do? function onCarrierSelect() {
1
4018
by: nupuragr82 | last post by:
I have a parent form and on button click I am calling a child page where i have a textbox and a button. On button click of child form I am passing the value of the Textbox to the Textbox in parent page and now I want to fire an event. Button click event on parent page- parameter is txtBlank (TextBox in parent page) function SetRange(Src) { window.open("SetRange.aspx?src=" + Src, "_blank", "status = 1, ontop=true, height=110,...
0
8379
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8816
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
8709
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
8596
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7309
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 projectplanning, coding, testing, and deploymentwithout 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...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2719
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

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.