473,569 Members | 2,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Close the Browser with Javascript

7 New Member
Hi,
Can you help me out to close browser using asp code? I don't want to click on any link . I have page1.asp, from where i am opening a pop-up window (page2.asp) which has a form having some fields.
I want to fill the form and after clicking on submit button, it is redirected to other page and at that time, i want to close the pop-up. there must be no link to close the window.
Dec 6 '05 #1
4 6611
Niheel
2,456 Recognized Expert Moderator Top Contributor
You will need to use javascript, and on-submit i think close the page. I will see if i can scour up some sample code for you.
Dec 6 '05 #2
Niheel
2,456 Recognized Expert Moderator Top Contributor
Here is some html/javascript code

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form method="POST" action="samplepage.asp" onsubmit="window.close();">
  3.      <--- FORM FIELDS/OPTIONS GO HERE ---->
  4. </form>
  5.  
Dec 6 '05 #3
Deepali
7 New Member
Thanks for helping, but there is a problem, the page which i want to close, calls a java script function when submit button is clicked, so how to write window.close(); in that function.
Through java script function, i submitted the form.
Dec 6 '05 #4
acoder
16,027 Recognized Expert Moderator MVP
Closing the window onsubmit would close the window before the form has been fully submitted. What should be done in this case is to close the window on body load in the action page, e.g.
[html]<body onload="window. close();">[/html]
Jun 22 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
95520
by: RonS | last post by:
Is there a way to close the present (active) window using PHP code?
2
7412
by: Rafael Chemtob | last post by:
Hi, Does anyone know how I can close a browser page via ASP code? thanks
9
3230
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make it more clear take a look at http://www.ithorizon.co.uk). I have inserted some code below to show what I currently have, but I don't have the...
16
2841
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my development. I have build some cross browser debuggers so my users can send me verbose debug dumps. I have some success but have come to a roadblock with the...
1
1439
by: Lance | last post by:
Hi, Is there a way to tell if a browser is currently capable of javascript? ie if the user has disabled it or not? I understand that the Request.Browser.JavaScript property will tell if a browser *may* be capable, I'd like to know if a browser is *currently* allowed to run javascript. The following test returns true, whether or not the...
2
1638
by: OB | last post by:
I want to be able to press a button on the Browser page and close that browser window. Anybody has a sample for ASP.NET 2.0? Thanks OB
2
3940
by: Webley | last post by:
Hello all...first time here...hope you can help me! I'm trying to get the original popup window to close on submit. Because there are actually 4 form tags on this page, I'm not sure if that's creating the issue, but I can't for the life of me find a piece of code that will close this window. I've tried window.close(); and...
1
2031
by: HemantSa | last post by:
Session exists when i close browser in firefox...is there any way to remove the session if i open the new browser instance.... Regards, Hemant Sandbhor
0
7701
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...
0
8130
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...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7979
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...
0
5219
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...
0
3653
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...
0
3643
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2115
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
1
1223
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.