473,414 Members | 1,691 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,414 software developers and data experts.

using close window buttons on a refreshed page

Hi all

I'm new to javascript and im trying to add a close button function to
my certain pages of my site. I use this code:

<a href='javascript:window.close();'>Close Window</a>

to create a hyperlink which closes the window. However with pages which
display data retrieved from a database using PHP i use a form to submit
a search on the page which displays results. At the bottom of the page
is the close window link, however it fails to work once a form has been
submitted on the page. It only works when the page first loads.

Any ideas guys on how i can get a close window option that works on my
results page after submitting a search?

Marc

Nov 1 '05 #1
3 1673
mc******@lycos.co.uk said the following on 11/1/2005 3:39 PM:
Hi all

I'm new to javascript and im trying to add a close button function to
my certain pages of my site. I use this code:

<a href='javascript:window.close();'>Close Window</a>

to create a hyperlink which closes the window. However with pages which
display data retrieved from a database using PHP i use a form to submit
a search on the page which displays results. At the bottom of the page
is the close window link, however it fails to work once a form has been
submitted on the page. It only works when the page first loads.

Any ideas guys on how i can get a close window option that works on my
results page after submitting a search?


<H1>To close this page, click the X in the upper right corner</H1>

Users know how to use the browser and it's built in mechanisms, stop
trying to reinvent the wheel and your problem will go away.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.mattkruse.com/javascript/bestpractices/
Nov 1 '05 #2
But still the unanswered question looms large in my mind, why does the
javascript not work when the webpage form is submitted?

Nov 1 '05 #3
mc******@lycos.co.uk said the following on 11/1/2005 5:29 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
But still the unanswered question looms large in my mind, why does the
javascript not work when the webpage form is submitted?


Who knows, without seeing a bare minimum sample page that displays the
behavior you describe, it is impossible to even guess.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

Nov 1 '05 #4

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

Similar topics

4
by: KS | last post by:
Is it possible to write a javascript that makes a popup window when someone click on buttons/href on my page and close itself when the new page is about to get loaded? I want to prevent the user...
1
by: Targa | last post by:
After I submit a form from a popup window, I use the following code to close the popup and refresh the parent window. <a href="#" onclick="window.opener.location.reload();self.close();return...
4
by: ...D. | last post by:
OK. I am halfway decent with HTML. Now I want to try javascript for some things that HTML cannot do. I have looked over a tutorial & all. What I want to do is create a button, that when...
4
by: moose | last post by:
OK Popup window? No problem PDF in popup? No problem But what about a couple of Close Window buttons? Imagine a "Close Window" button at the top of the popup page. Then the PDF which can...
10
by: Shang Wenbin | last post by:
Hi, When I want to close the current window using window.close() in IE6.0, there will be a confirm box that: The web page you are viewing is trying to close the window. Do you want to close this...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
1
by: gvrajkumar | last post by:
Hi Popup window is opened and after some time session has expired. After session expire, if the user tries to make any actions on the popup page the user is redirected to login.jsp page. What...
4
by: Linda | last post by:
My environment is Windows Server 2003, .NET Visual Studio Academic 2003, ASP.NET. I need to create a page with no top title bar, no mimize button, no maximize button, no close button. It is for a...
3
by: J-Burns | last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in programming itself... :P. Need some help here. Problem 1: How do I make something appear on 2 separate windows using Tkinter? By...
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
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
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...
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
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...
0
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...
0
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...

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.