7

How to set radio button checked by default in struts html tag ?

<html:radio name="RegisterForm" property="Group"  value="<%=Contant.Male%>"/><label>Male</label><BR>
<html:radio name="RegisterForm" property="Group" value="<%=Contant.Female%>"/><label>Female</label>

Here, i have to set Male as default one. Thanks in advance.

siva
  • 165
  • 1
  • 4
  • 11

1 Answers1

7

Just make sue that your controller sets the corresponding property in the form before dispatching to the view:

form.setGroup(Constant.Male);
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255