Mark said:
Yes, I believe I have done all this to a satisfactory level. The window
opens up, and sits there with my page. The main window gets re-directed to
the required destination. If you click on the main window, my window comes
up on top - All works perfectly, except for the fact, I cannot type in my
window (the window contains a form) rendering the whole application useless
:-(
It /appears/, that when I type, the onblur event is being called, so
recalling the window, rather than registering the keypress as a character.
No, this is not possible as I need the full screen of the main page, then
this popup window is a small window which overlaps a square piece of 'dead
space' on the main site.
On a side note --- Windows programming is all very new to me, so things like
eventhandlers are a complete nightmare. I used to program in C++/ASM back in
the days of dos, so I do understand the basics of logic and functions etc,
but the windows part is a real non-starter for me - Can anyone recommend any
books with good examples? I have various 'reference' books for function
names / parameters, but these obviously do not show me how to implement the
procedure into my code.
Thanks, Mark
Boy, people certainly are argumentative around here...
Have you looked into HTAs? Where browser coverage isn't an issue - and
you don't mind using IE (ugh) the flexibility is tremendous.
Otherwise...
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>untitled</title>
</head>
<body>
<input type="button" value="open it"
onclick="window.open('pop.html','pop','width=400,height=300,left=100,top=100,status=0')"
/>
</body>
</html>
[pop.html]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>untitled</title>
<script type="text/javascript">
//<![CDATA[
var timerID = null;
onblur = function()
{
timerID = setTimeout('self.focus()', 50);
}
onload = function()
{
var i = 0, el, els =
document.getElementsByTagName('form').item(0).elements;
while (el = els.item(i++))
if (/text(area)?/.test(el.type))
{
el.onfocus = function()
{
if (timerID)
clearTimeout(timerID);
}
el.onblur = function()
{
timerID = setTimeout('self.focus()', 50);
}
}
self.focus();
}
//]]>
</script>
</head>
<body>
<form style="width:120px;">
<input type="text" name="foo" value="" />
<input type="text" name="feh" value="" />
<textarea name="hah" rows="4" cols="24"></textarea>
</form>
</body>
</html>
Just uses a timer to 'reverse' the order of blur/focus firing so you
can control them. Assuming one form in that popup.