Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Internet Explorer / General Topics / June 2007

Tip: Looking for answers? Try searching our database.

Text input focus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott Heath - 22 Jun 2007 15:45 GMT
My problem: my page has a select box. When the user selects an item, a div
appears with a text input. The input has an ID value, and the value of the
selected option gets stored in a variable. The command
getElementById('inputID').focus() puts the text pointer in the input
textbox, so the user can just start typing. In other browsers, this works as
expected.

In IE6 and IE7, this not only doesn't work, but if a key is pressed before
the mouse is placed over the input and clicked, the select element retains
focus and IE resets the variable to whatever option starts with the
character typed!

Can anyone tell me if there is some other way to automatically put the text
pointer into the text box, or at least block the automatic selection of
options from a select element?

Developed on FF2/Mac, tested on IE6 and IE7 under Windows XP.
Scott Heath - 22 Jun 2007 17:38 GMT
It was just IE or PC (or me) slowness.  I added a slight delay:
setTimeout("document.getElementById('inputID').focus();", 100);
Now it allows time for the div to create its input control and assign the
ID; it works in both browsers. Sorry if I caused confusion by asking for the
right way when I was doing the right thing, just too quickly for it to work
in IE.

On 6/22/07 8:45 AM, in article C2A13C9F.ADB9%Scott_Heath@bonfils.org, "Scott
Heath" <Scott_Heath@bonfils.org> wrote:

> My problem: my page has a select box. When the user selects an item, a div
> appears with a text input. The input has an ID value, and the value of the
[quoted text clipped - 13 lines]
>
> Developed on FF2/Mac, tested on IE6 and IE7 under Windows XP.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.