Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<html:radio> Check radio button default in struts html tag

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.

like image 485
siva Avatar asked Jan 09 '13 14:01

siva


1 Answers

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

form.setGroup(Constant.Male);
like image 155
JB Nizet Avatar answered Oct 15 '22 15:10

JB Nizet