Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set default value for a radio button?

 
Deepak Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Deepak Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. Its working fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic