This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Struts and the fly likes Spooky tabindex problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Spooky tabindex problem..." Watch "Spooky tabindex problem..." New topic

Spooky tabindex problem...

A Harry
Ranch Hand

Joined: Jan 23, 2002
Posts: 124
Using struts 1.1, IE 5.5 (sp2)
I have several <html:text> fields but for some reason the "tabindex" property refuses to work.
The first field is -
<html:text property="projectfullcode" size="4" maxlength="4" tabindex="1"/>
When the page is first displayed you cannot tell where the focus is, press tab once & it goes to the address bar, again then it goes to "projectfullcode".
What am I doing wrong? - probably something really stupid! - any ideas?
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

I believe the autotab is not the same as setfocus. autotab is simply a way to select the ORDER that fields go through when tabbed. Initially, no field on the page has focus unless you specify it. I don't know if there is a way to set focus without javascript, off-hand. Someone else may know.

A good workman is known by his tools.
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6323

I believe the html:form tag has a focus attribute that will let you specify which field should receive initial focus.

Junilu - [How to Ask Questions] [How to Answer Questions]
I agree. Here's the link:
subject: Spooky tabindex problem...
It's not a secret anymore!