aspose file tools*
The moose likes Struts and the fly likes How to set default value for a radio button? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to set default value for a radio button?" Watch "How to set default value for a radio button?" New topic
Author

How to set default value for a radio button?

Deepak Kumar
Ranch Hand

Joined: Nov 05, 2007
Posts: 62
Hi All,

I have three radio buttons as below.

<html:radio value="con" property="radio"/><b>Conf</b>
<html:radio value="N" property="radio"/><b>Number</b>
<html:radio value="Continue" property="radio"/><b>Select all data and continue...</b>

I want to set the radio value="Continue" for default selection

How can I do that?

Thanks & regards,
Deepak


Thanks,
Deepak
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Sometime before displaying the JSP, either in the reset(...) method of the ActionForm or in an Action class that forwards to this JSP, just set the value of the radio property to "Continue". Struts will automatically cause the correct button to be selected based on the value of the ActionForm property.


Merrill
Consultant, Sima Solutions
Deepak Kumar
Ranch Hand

Joined: Nov 05, 2007
Posts: 62
Thank you very much. Its working fine.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set default value for a radio button?