File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes focusing on radio button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "focusing on radio button" Watch "focusing on radio button" New topic

focusing on radio button

Michelle Cox

Joined: Feb 24, 2004
Posts: 4
Hi, can anyone pls help me figure out how to set focus on a radio button.
I have my body tag defined generically in my tiles layout, and I call mySetFocus() in the onload event.
if(document.forms[0] != null) document.forms[0].elements[0].focus();
But this seems to have no effect on radio buttons, although it works for text fields.
Trying to set the focus on every individual page, like
html:form action="/SubmitPage" focus="RadioBtn[0]" causes an error.
Does anyone have any idea what is to be done... Thx.
[ March 01, 2004: Message edited by: Michelle Cox ]
Michelle Cox

Joined: Feb 24, 2004
Posts: 4
Are my questions too stupid or somethin'.. Why isn't anybody asnwering them???
lee anthony
Ranch Hand

Joined: Jan 23, 2004
Posts: 35
hi beleive u got the answer for ur question
but in addition to the same in focus u put the property name of radiobutton which u have reflected in bean form class
i beleive this will help u,
I agree. Here's the link:
subject: focusing on radio button
It's not a secret anymore!