Problem with onblur=self.close

O

oliver gargour

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.
 
R

Randy Webb

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top