Html: radio tag How to get the value passed

Category: Java EE
 
mvart1
2011-04-25 07:13:10

Sponsored Links
Also search the Internet for a long time, this is my source
<html:radio property="student.sex" value="${student.sex}">
</ html: radio> Men
<html: radio property = "student.sex" value = "$ {student.sex } ">
</ html: radio> Female <br>

value =" $ {student.sex} "> from requestScope scope to deposit, and I want to be a modification operation, but came
not receive the value of the corresponding button is not selected men and women, how to get him is male, then the male of that button
is selected, on the contrary, is a woman, then the woman that button selected.

Sponsored Links

yhaa368
2011-04-25 07:31:12
String sex = "M";
if (request.getParameter ("sex"). equals ("0"))
sex = "M ";
else
sex =" female ";
siyan1989
2011-04-25 07:38:31
ah you design complexity, did not see to write two pairs of html tags do not understand, ah, dreamwearver painting look, look at the code.
zzxxmin
2011-04-25 07:46:43
<input type="radio" name="sex" value=0 checked> male
<input type = "radio" name = "sex" value = 1> Women

value gets passed the sex, you know a male or female.
piaopiao_lucky
2011-04-25 07:59:03
l F: I This is the struts html tags, you know the kind I
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.