473,811 Members | 3,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

focus problem in showModalDialog

I have this window where I open a modal dialog window using the code:

newwin=window.s howModalDialog( url, "popup", features)

where features are
dialogLeft:"+x+ "px;dialogTop:" +y+"px;dialogWi dth:"+w+"px;dia logHeight:"+h+" p
x;center:0"

In the window that opens I call a function - setVar() in the body onLoad
event.

The setVar() function contains the following code:

this.form.Name. focus();
this.form.Name. select();

but although the window seem to have focus, I cannot see the cursor in the
form.Name textbox, and if I try to type something nothing happens. If I do a
Alt-tab back to the other window and then back again to the modal window,
the cursor is blinking in the Name field and I can type as normal. What is
causing this behaviour, and what can I do to fix it?

Can anyone please help with this?

Thanks!
iv**@tda.no

Windows XP SP1 IE6 SP2
Jul 23 '05 #1
2 6734
Hello,

I am using Windows XP SP1 IE 6 - but not SP2.
First of all: You don't need the select() function in order to set the
focus; focus() should be enough.
Second: I have tried the following example - according to your description -
and it works correctly.
The focus is in the text field and you can type any characters within it.
page1.html
---------------------------
<html>
<head>
<title>Page 1</title>
<script language="JavaS cript">
function func() {
newwin=window.s howModalDialog( "page2.html ", "popup",
"dialogLeft:50p x;dialogTop:50p x;dialogWidth:3 00px;dialogHeig ht:200px;center :
0");
}
</script>
</head>
<body>
<form>
<input type="button" value="please click" onClick="javasc ript:func()">
</form>
</body>
</html>
page2.html
---------------------------
<html>
<head>
<title>Page 2</title>
<script language="JavaS cript">
function setVar() {
document.forms[0].Name.focus();
}
</script>
</head>
<body onload="javascr ipt:setVar()">
<form>
<input type="text" name="Name" value="">
</form>
</body>
</html>
Maybe you want to try this. Hope this helps you.

Nice greetings from
Thomas
Jul 23 '05 #2
Hi!

I did sort'of know about the superfluous select(). I know focus() should be
enough. I just was a bit surprised that it didn't work.

But I found the problem causing this behavioiur. Strange noone else here
knew about it, but perhaps I gave a little sparse information to deduct that
this was the problem.

The problem is the somewhat faulty Sun java-plug in 1.4.1 which causes this
strange behaviour. Sun knows about this according to my sources, but
apparently don't bother to do anything about it. Swithching back to the MS
Java engine fixed the problem.

Thanks for your kind help! Your tip is duly noted ;-)

Brgds
Iver in Oslo

"Thomas Hoheneder" <th************ **@gmx.de> skrev i melding
news:ck******** **@domitilla.ai oe.org...
Hello,

I am using Windows XP SP1 IE 6 - but not SP2.
First of all: You don't need the select() function in order to set the
focus; focus() should be enough.
Second: I have tried the following example - according to your description - and it works correctly.
The focus is in the text field and you can type any characters within it.
page1.html
---------------------------
<html>
<head>
<title>Page 1</title>
<script language="JavaS cript">
function func() {
newwin=window.s howModalDialog( "page2.html ", "popup",
"dialogLeft:50p x;dialogTop:50p x;dialogWidth:3 00px;dialogHeig ht:200px;center : 0");
}
</script>
</head>
<body>
<form>
<input type="button" value="please click" onClick="javasc ript:func()">
</form>
</body>
</html>
page2.html
---------------------------
<html>
<head>
<title>Page 2</title>
<script language="JavaS cript">
function setVar() {
document.forms[0].Name.focus();
}
</script>
</head>
<body onload="javascr ipt:setVar()">
<form>
<input type="text" name="Name" value="">
</form>
</body>
</html>
Maybe you want to try this. Hope this helps you.

Nice greetings from
Thomas

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1402
by: George Fernett | last post by:
Hi all, I have a page that lists codes and when a code is clicked on, I wanted to show the full text description for the code. Response.Write("<td nowrap>" & "<a href=""/scripts/codedescription.asp?lcode=" & oRS.fields("jspcde") & " "" target=""tu"" onclick=""var tu=window.open('','tu',config='height=360,width=350,location=0,menubar=0,too lbar=0,resizable=0,status=0,scrollbars=1');tu.moveTo(410,120)""><font color=""#0000cc"">" &...
2
3774
by: Moist | last post by:
Hi, first I must admit this is one of the most active group I have ever seen. For my question: is it possible to create a small popup window that remain in focus until it is closed. That is, even if you click on the main (caller) window just beside the popup, the popup would remain in focus. I've tried "alwaysRaised" with window.open() function but it doesn't work, must be for something else!!!
10
4317
by: CyberBless | last post by:
I have a page that opens a child window using window.open(...). How do I make so that when that child window opens you cannot get the focus back on the parent window unless you close the child window? Is it even possible?
2
16150
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for showModalDialog. It is modal as far as the client is concerned but not the server... In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
4
808
by: MW de Jager | last post by:
I want to call ShowModalDialog(...) from my C# code in the code behind page of my aspx page. I do not want to link this to a button, since I want to first do some checking myself before I call the showModalDialog. I also want to receive a result back from the ShowModalDialog when it is closed. My problems are currently these: (1) If I call the showModalDialog using RegisterClientScriptBlock, then I have no way of receiving a return...
2
1372
by: Namespace | last post by:
Hi I am having a problem with opening a new browser window through a client-side javascript (window.open/_blank) function. The window do "pop up" but behind the window where I pushed the "pop up" button. It works ofcause with the window.showModalDialog method but then postback causes another window to pop up, so I'm back to the window.open method. How can I set foucs on the new pop-up window from the parent browser window?
3
3091
by: johkar | last post by:
Just want a verification of logic. This seems to work for IE and Firefox, but I wonder if it would be a problematic test in any of the other latest browsers? Is the use of the "window" object correct? I didn't think it would be document.showModalDialog. if(window.showModalDialog){ //do something } else {
5
1675
by: pd | last post by:
guys, i am trying to put the focus on my popup. When the user clicks on a button i display a popup and want to keep it in focus ie, the user cant minimise or do anything unless they close the pop up first. now i have implemented this using onblur=window.focus() on my popup. and this works fine, the user cant do anything till they close the pop. but i also have some form controls within my pop-up, which have now become useless. i cant...
6
2621
by: David | last post by:
Hi all, I am opening a webform with showModalDialog. This appears to pop-up fine, though I have a problem... Inside the webform is a treeview control. When the treeview is populated, I am setting the treenode navigateurl to javascript:Click('test')
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7665
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6882
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.