JSP---根据值让某一Radio处于选中状态

<tr>
<td>
性别
</td>
<%
String sex = student.getStud_sex();
%>
<td>
<input type="radio" value="男" name="stud_sex"
<%if (sex.equals("男"))
out.print("checked");%> />

<input type="radio" value="女" name="stud_sex" <%if (sex.equals("女"))
out.print("checked");%> />

</td>
</tr>

你可能感兴趣的:(Radio)