This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "focusing on radio button" Watch "focusing on radio button" New topic
Author

focusing on radio button

Michelle Cox
Greenhorn

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.
mySetFocus
{
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
Greenhorn

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,
lee
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: focusing on radio button
 
Similar Threads
can i pass a variable through javascript function to another struts jsp page?
Struts 2 <s:submit action > and javascript help
form bean value not getting
geting focus on radio button
IE sucks: compatibility mode turns on when executing javascript