473,406 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Close the Browser with Javascript

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 6605
Niheel
2,460 Expert Mod 2GB
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,460 Expert Mod 2GB
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
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 Expert Mod 8TB
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
by: RonS | last post by:
Is there a way to close the present (active) window using PHP code?
2
by: Rafael Chemtob | last post by:
Hi, Does anyone know how I can close a browser page via ASP code? thanks
9
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...
16
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...
1
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...
2
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
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...
1
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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
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,...

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.