473,395 Members | 1,999 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Focus on Select

Hi,

Is there a way to focus on a drop down list of a form.

I tried element.focus() select() click() in vain....

TIA
Regards,
Nicky.
Jul 20 '05 #1
2 2993
"Nicolas Mainczyk" <nm*******@hotmail.com> wrote in message news:<br*********@ngspool-d02.news.aol.com>...
Hi,

Is there a way to focus on a drop down list of a form.

I tried element.focus() select() click() in vain....


Where did you call focus()? The following worked fine for me:

....
function init() {
document.forms[0]["items"].focus();
}
....
<body onload="init()">
....
<select name="items">
Jul 20 '05 #2
Chris Riesbeck wrote:
"Nicolas Mainczyk" <nm*******@hotmail.com> wrote in message news:<br*********@ngspool-d02.news.aol.com>...
Your attribution line exceeds the recommended maximum of 78 characters
per line. This is not necessary since it contains a lot of superfluid
information that can be retrieved through message headers by those who
are really interested in it.
I tried element.focus() select() click() in vain....


Where did you call focus()? The following worked fine for me:

....
function init() {
document.forms[0]["items"].focus();


The sane way is

document.forms[0].elements["items"].focus();
}

Merry Christmas! (if you celebrate it)

PointedEars
Jul 20 '05 #3

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

Similar topics

2
by: Paul Thompson | last post by:
I am trying to use various javascript tools, all of which work in NN, to work in IE. Here's my latest annoyance. I get a list of all objects on a page using docContents =...
9
by: Roger Withnell | last post by:
Tearing hair out time! Simple attached page shows the problem. http://www.brilley.co.uk/TestFocusSelect.htm Using a function to test if too many characters have been keyed in to a textarea....
3
by: Dave | last post by:
We are developing a web page that shows large graphics. To provide more screen space for the graphics, we allow the user to popup a window that places itself over the top part of the browser. This...
8
by: Yeah | last post by:
I wish to use a drop box where each Option will not take the user to a web page - but a certain location on the same page the drop box exists. For example, Option 1 would take the user to "Chapter...
17
by: Neil Ginsberg | last post by:
OK, this is a stupid thing, but I can't seem to get this to work. I have a form with a subform (in continuous form view). A combo box on the main form has code in the AfterUpdate event which adds a...
9
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application...
1
by: Josh C. | last post by:
I am attempting to dynamically add an option to a select box when the box is selected (click or focus). This works fine using Firefox by either creating a new element and appending it to the...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
10
by: Derek Hart | last post by:
I can set focus to my property grid by using propgrid.Focus - but how can I set the default property that is always first? Or just set focus to the default property? Can this be done?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.