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

≯℡__Kan透↙ 提交于 2019-12-10 04:19:12

问题


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.


回答1:


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

form.setGroup(Constant.Male);


来源:https://stackoverflow.com/questions/14237731/htmlradio-check-radio-button-default-in-struts-html-tag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!