473,769 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

closing a popup form

Hello. This is a strange problem which does not make sense to me.

I open a popup page with the following javascript code:

function OpenDenyWindow( changeId) {
retVal=window.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

Nov 18 '05 #1
4 3015

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
Hello. This is a strange problem which does not make sense to me.

I open a popup page with the following javascript code:

function OpenDenyWindow( changeId) {
retVal=window.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then a duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are probably
seeing is close and then re-open again !

Nov 18 '05 #2
The popup form is submitted to itself through this button:

<asp:Button ID="btnSend" Runat="server" Text="Send Denial"></asp:Button>

Then, the click event in the code-behind sends the javascript to the page:

Private Sub btnSend_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSend.Click
...do stuff....
CloseWindow()
End Sub

Private Sub CloseWindow()
'Response.Write ("<script
language='javas cript'>window.c lose();</script>")
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.parent. close();window. close();</script" & ">")
End Sub

So, do you think when a button is clicked on the popup form, it create
another browser window? How can I get around this?

"Zoe Brown" <zo*******@d-o-n-o-t-s-p-a-m-tfn.com> wrote in message
news:40******** @primark.com...

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
Hello. This is a strange problem which does not make sense to me.

I open a popup page with the following javascript code:

function OpenDenyWindow( changeId) {
retVal=window.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form,
then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are

probably seeing is close and then re-open again !


Nov 18 '05 #3
The popup form is submitted to itself through this button:

<asp:Button ID="btnSend" Runat="server" Text="Send Denial"></asp:Button>

Then, the click event in the code-behind sends the javascript to the page:

Private Sub btnSend_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSend.Click
...do stuff....
CloseWindow()
End Sub

Private Sub CloseWindow()
'Response.Write ("<script
language='javas cript'>window.c lose();</script>")
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.parent. close();window. close();</script" & ">")
End Sub

So, do you think when a button is clicked on the popup form, it create
another browser window? How can I get around this?

"Zoe Brown" <zo*******@d-o-n-o-t-s-p-a-m-tfn.com> wrote in message
news:40******** @primark.com...

"SteveS" <ss*****@trendm ls.com> wrote in message
news:#g******** ******@TK2MSFTN GP10.phx.gbl...
Hello. This is a strange problem which does not make sense to me.

I open a popup page with the following javascript code:

function OpenDenyWindow( changeId) {
retVal=window.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form,
then a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

where is the form submitted ? if it is submitted to itself you are

probably seeing is close and then re-open again !


Nov 18 '05 #4
Hi

To prevent a new page opening set the base target in the dialog
<base target="_self">
http://msdn.microsoft.com/library/de...ies/target.asp

Or use a iframe in the dialog and host the page there

After a postback success return a script to close the dialog
<script>window. close();</script>

--
Best Regards
Vidar Petursson
=============== ===============
Microsoft Scripting MVP
http://www.microsoft.com/technet/scriptcenter
=============== ===============
"SteveS" <ss*****@trendm ls.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hello. This is a strange problem which does not make sense to me.

I open a popup page with the following javascript code:

function OpenDenyWindow( changeId) {
retVal=window.s howModalDialog( 'DenialEmailFor m.aspx?id=1234' ',
'dialogWidth:65 0px; dialogHeight:70 0px; resizable:no;') ;
//alert("Return val = " + retVal)
}
The screen opens fine. However, I can't get it to close after I the user
submits the form. I run this code in my click event:

Response.Write( "<script language='javas cript'>window.c lose();</script>")
OR
Page.RegisterSt artupScript("Au toClose", "<script language
=""javascript"" >window.close() ;</script" & ">")

Both of these statements do not work.

The problem gets more interesting. If I don't try to close the form, then
a
duplicate popup form appears. Now, I have 2 popup forms!

Make sense?

This has me bewildered! Any ideas what is going on?

Thank you for your help!!

SteveS

Nov 18 '05 #5

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

Similar topics

1
2461
by: MJEASSOC | last post by:
I need some help with closing a popup window. I'm making an online portfolio, that has one base page with text and thumbnails. When a user clicks on a thumb, a new window opens containing a larger image and a caption (each contained on a separate htm document). I do this with a function in the header script as follows: var picpage=" "; var params=" ";
4
2634
by: Ellen Manning | last post by:
Using A2K. I have a form that allows the user to print one or more reports. The user checks which report they want printed then they click on a button to start printing. A popup form displays when they click on the button and prompts them for a date range. This date range is then used on each report. (I make the popup invisible when the range is entered. So it's open during the printing so that the reports can access the date range.)...
4
5874
by: deko | last post by:
I have a pop-up form in which user-defined parameters are entered. The parameters are entered into a subform datasheet which is bound to a table. I need to check the product of two parameters to make sure they are valid before updating them (or closing the popup form), so I use this code: Private Function BadValue() As Boolean If Me!Die * Me!Site > 32000 Or Me!Die * Me!Site < 0 Then MsgBox "Die and/or Site out of range." & vbCrLf &...
3
313
by: SteveS | last post by:
Hello. This is a strange problem which does not make sense to me. I open a popup page with the following javascript code: function OpenDenyWindow(changeId) { retVal=window.showModalDialog('DenialEmailForm.aspx?id=1234'', 'dialogWidth:650px; dialogHeight:700px; resizable:no;'); //alert("Return val = " + retVal) }
3
1739
by: thechaosengine | last post by:
Hi all, I need to be able to cause the following chain of events after clicking an asp:button but I don't know how to do it. I'd really appreciate any advice on this or alternative approaches: The window in question is a popup asking the user to provide some details. The primary window is still open in the background 1. Button on popup clicked
4
2917
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes Access, the system just hangs and Access apparantly cannot close. I have to open the Windows Task Manager and force the closing (and even that takes quite awhile).
1
5198
by: Tyrone Slothrop | last post by:
Any idea of why this will not work? I have an image editor in a popup that is opened from a form in a window containing data as well as displaying images for the record. When the image has been saved, it posts to the form in the opener from the popup, updating the record with the new image. Everything is working perfectly but the popup refuses to close. After the image is saved to the server, this is the HTML which is generated:
4
8850
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
3
1948
by: =?Utf-8?B?Vk1J?= | last post by:
How can I close popup window automatically when I close the parent window (the application itself)? Thanks.
0
9586
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10043
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
9861
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...
1
7406
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
6672
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
5298
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3956
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
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.