By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,738 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,738 IT Pros & Developers. It's quick & easy.

Problem with onblur=self.close

P: n/a
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
Share this Question
Share on Google+
1 Reply

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.