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 How to make Struts radio button selected by default 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 "How to make Struts radio button selected by default" Watch "How to make Struts radio button selected by default" New topic
Author

How to make Struts radio button selected by default

aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
Hi,
below is my code:

<s:radio name="abc" id="xyz" cssClass="formElementRadioButton" list="{'instant'}"/>

Can anyone guide me how to make the above radio button selected by default?

Thanks
Aman


Aman Thind
SCJP,SCWCD
JAVA utte mar JAVA,mit JAVA
Anbarasu Aladiyan
Ranch Hand

Joined: Jun 02, 2009
Posts: 182

Hi aman thind ,

I think you can make use of attribute.


A.A.Anbarasu
aman thind
Ranch Hand

Joined: Jun 29, 2007
Posts: 71
anbarasu aladiyan wrote:Hi aman thind ,

I think you can make use of attribute.


Thanks buddy,it worked
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to make Struts radio button selected by default
 
Similar Threads
using html:radio
how to make html:radio default selected
html:radio
validating textfield with +ve/-ve values using 2 radiobuttons
Check a checkbox after hitting a reset button