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

Setting focus - setActive();

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

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