470,863 Members | 1,344 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,863 developers. It's quick & easy.

Setting focus - setActive();

Hi

I have....

<body onload="document.forms[0].elements[0].setActive();">

This sets focus to the element, but when pressing TAB it does not go
to the next element. It will go to some other point (link before or
the address in the browser)
Is there another way?

BR
S

Feb 16 '07 #1
1 5325
ASM
jodleren a écrit :
Hi

I have....

<body onload="document.forms[0].elements[0].setActive();">

This sets focus to the element, but when pressing TAB it does not go
to the next element. It will go to some other point (link before or
the address in the browser)
Is there another way?
don't know how you fix your setActive();
I can't reproduce what you say.

=== soluce 1 ===

<body onload="document.forms[0].elements[1].focus();">

=== soluce 2 ===

function setActive(what) {
what.focus();
// what.select();
}

<body onload="setActive(document.forms[0].elements[0]);">

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Feb 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Charles Eubanks | last post: by
20 posts views Thread by Arne | last post: by
2 posts views Thread by Mystery Man | last post: by
3 posts views Thread by Frances | last post: by
7 posts views Thread by Zytan | last post: by
3 posts views Thread by kelvin.koogan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.