on 05-13-2006 2:39 PM
Hi all,
I am opening a pop-up window from my main screen using
window.open().But I am not able to set focus on it.
I have tried onLoad="self.focus();" ,but it does not work. Then I tried onBlur="self.focus();".But in this case,many elements on the pop-up itself stops working.
How do I disable access to the calling page,once the pop-up comes ? Please help.
Thanks®ards,
Ananya
Dear Ananya,
Use onload="window.focus()".
You cannot disable access to the calling page, if you are using window.open. But if you use a Modal Dialog Window, then the user can access only the opened window. It is explained in the Advanced BSP Programming book, written by Thomas Jung and Brian McKellar, published by SAP-Press.
Regards
Gladson
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try the following code.
<script language="javascript" type="text/javascript">
<!--
function popitup(url)
{
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}
// -->
</script>
for more on this check out this link.
http://www.quirksmode.org/js/popup.html
Regards
Raja
Hi Raja,
I tried as you have suggested. But what happens is:When I click outside the pop-up window,
the pop-up just disappears( actually gets minimized and remains in the Windows task bar). Supposing, I close the main calling page,the pop-up still remains in minimized status.
But what I need is,when the pop-up comes,I must not be able to click anywhere on the main page.Focus will be confined to the pop-up. Only when user closes the pop-up,focus will come back on main page.
And I have to do all this using window.open..Please help.
Regards
Ananya
your only option is to use Modal Dialog .
check out this on Modal Dialog.
http://www.webreference.com/js/column90/
What problem are you facing when working with modal dialog.
May be we will try to address the problem you are facing with modal dialog.
Regards
Raja
Hi Raja,
I was repeatedly trying with modalDialog upto now, but in this case sometimes the onInputProcessing of the pop-up works,sometimes not.
Also,various commands like window.opener.close() etc..fails if I use window.showModalDialog because in this case it cannot identify an opener.
Only if I open a pop-up by window.open(), that pop-up can identify commands like window.opener.close etc..which I need in this case.
So.Basically I need to make it work with window.open only
Regards,
Ananya
I understand that.
But i have to do some reading before i could answer further on this.
i am currently readin this http://www.webreference.com/js/tutorial1/dialog.html
you can also try that.
Regards
Raja
Hi Ananya,
use the following Code.
<a href="javascript:show_contact()">[Help&Contact]</a>
<script type="text/javascript">
function show_contact()
{
var url = "contact.htm"
var pw = window.open(url,'Contact','height=300,width=300,top=200,left=100,toolbar=0,location=0,status=0,menuBar=0,scrollBars=1,resizable=1')
<b>pw.focus()</b>
}
</script>
Regards
Aashish Garg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The problem is not solved yet. Any help on how t solve this with window.open() ?
Regards,
Ananya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.