Setting focus - setActive();

J

jodleren

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
 
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]);">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top