View Full Version : keeping child window on top
allida77
09-11-2002, 04:51 PM
Is it possible to keep a popup window on top of the Parent window when clicking back into the Parent window? I am wanting to allow a user to edit fields on the parent window and when they are entered they can see the values in the child window. I tried the onblur="self.focus(); in the child window but that will not allow you to edit fields on the parent window.
Make Sense?
Thanks in advance....
Try this:
<script>
function openwin(){
win1=window.showModelessDialog('yourpage.htm','','dialogHeight: 300px; dialogWidth: 400px; edge: Sunken; center: Yes; help:No; resizable: Yes; status: Yes;scroll:no')
}
</script>
<a href="javascript:openwin()">Open win</a>
Note
where the smiley is in the link there should be the letter "o"
requestcode
09-11-2002, 06:00 PM
You could try this in your popup:
function ontop()
{
self.focus();
setTimeout('ontop()',2000) // 2000 milliseconds
}
<BODY onLoad="ontop()">
But even with the above script you are still going to have problems. The function will probably get performed by the setTimeout at the same time someone is entering text into a text box which will cause them to lose focus on the text box.
allida77
09-11-2002, 07:51 PM
MrJ that worked but now I have run into another problem. I usually retrieve values in my child form doing this:
var myValue = window.opener.document.forms[0].hdnchkID.value;
With your function I can not do this, it says window.opener.document is null or not an object.
What do I use I retrieve the values from the parent window?
Unfortunately I do not know,
have not figured out,
have not read,
how to retrieve data from the child window
only that data can be set to the child window
Hi Allida77.
I came across some useful information about the Modeless popup.
Take a look here:
http://www.webreference.com/js/column90/index.html
allida77
09-16-2002, 05:04 PM
Thanks for the link and help.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.