473,398 Members | 2,088 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,398 software developers and data experts.

Problem with onblur=self.close

Hello,

I am using the following code in a popup.

<html>
<head>
<title></title>
</head>
<body onLoad="this.focus();" onblur="self.close">
<form action="" method="get">
<table>
<tr>
<td>Would like to ba able to select following text without windows
closing</td>
</tr>
</table>
</form>
</body>
</html>

Need the popup to close when the window blurs. However I also need to be
able to select the text within the table without having the popup closing.
This will work without the table but I must use a table unfortunately. Any
ideas?

Thanks for your help.
Feb 12 '07 #1
1 2566
oliver gargour said the following on 2/12/2007 6:18 PM:
Hello,

I am using the following code in a popup.

<html>
<head>
<title></title>
</head>
<body onLoad="this.focus();" onblur="self.close">
Should be self.close()

onblur="checkIt()"

var closeTheWindow=true
function checkIt(){
if(closeTheWindow){window.close()}
}

<td onfocus="closeTheWindow=false" onblur="closeTheWindow=true">

Untested. The idea is to set a global flag variable when the td element
gains focus. Then check that variable when the window loses focus.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 13 '07 #2

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

Similar topics

2
by: Dennis | last post by:
This may be easy for most but I can't get this thing to work. I believe I followed all the instructions but when I click on the link no window opens just the default IE page cannot display. Here is...
4
by: Raymond Wilk | last post by:
I used javascript to open a new window, then used the following to close the new window on the next click: <body onBlur="self.close()" onClick="self.close()" bgcolor="#FFFFFF"> On the new window...
4
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with...
3
by: rittersporn | last post by:
I want to model relations between "Groups" and also annotate the relations! My solution so far: Group - GroupName : Text | PRIMARY_KEY - Titel : Text - Info : Memo
2
by: joe | last post by:
Question about javascript -> onblur='self.focus' I use the method <body onblur='self.focus'> to keep the child browser always on the top , it success, but the textbox inside the child browser can...
3
by: EnjoyNews | last post by:
I have a popup problem. I have a script that generates a popup for image viewing. It has 2 function, and the first is that it automaticly generates the popup window to the size of the image,...
1
by: suresh_nsnguys | last post by:
Hi, i am displaying google.com website inside a frame with frameset setting onblur="self.focus();". but when i am trying to enter some text in google search box,the text is not getting...
1
by: liu | last post by:
I have some thumbnails and once clicked it creates a new window. I don't want extra windows everywhere so I'd like it to auto-close when it's in the background. I've found <body...
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
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
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
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...

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.