Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Setting focus - setActive();

Reply
Thread Tools

Setting focus - setActive();

 
 
jodleren
Guest
Posts: n/a
 
      02-16-2007
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

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      02-16-2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulating window.focus in Body onload() event and setting focus to a control on same page Jason ASP .Net 4 05-07-2007 05:54 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Fuji EXIF: Focus warning: "Out of focus" Hasan Diwan Digital Photography 3 12-26-2004 04:13 AM
Pan Focus vs Auto Focus JethroUK© Digital Photography 2 08-11-2004 06:26 PM
any manual focus cameras easy to focus? Catherine Jo Morgan Digital Photography 6 11-05-2003 06:36 PM



Advertisments