This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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?
 
Similar Threads
problem with "html:radio"
radiobutton problem
html:radio
How to make dynamic radio button checked
how to make html:radio default selected