By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,600 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,600 IT Pros & Developers. It's quick & easy.

Focus on Select

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.