How to get to the action, the value of radio

Category: Web Develop
 
Liqianhui
2010-07-11 01:09:53

Sponsored Links
<tr> <td> <font color="#990000" size="2"> Gender: </font>
<td> <input type = "radio" name = "sex1" value = "nan" /> <font color="#990000" size="2"> M </font>
<input type="radio" name="sex" value="nv" checked="checked" /> ; <font color="#990000" size="2"> female </font> </td> </tr>

please tell prawn My next how to get in the action selected value. .
encapsulated form where I want to write to the database

Sponsored Links

jojow
2010-07-11 01:16:49
<input type="radio" name="sex1" value="nan"/> ; <font color="#990000" size="2"> M </font>
<input type = "radio" name = "sex" value = "nv" checked = "checked" /> <font color = "# 990000" size = "2"> women </font> </td> </tr>

two are defined as a name on the line that is selected will be sent to the background
sourxsu
2010-07-11 01:28:37
<tr> <td> <font color="#990000" size="2"> Gender: < ;/ font>
<td> <input type="radio" name="sex" value="nan"/> <font ; color = "# 990000" size = "2"> M </font>
<input type = "radio" name = "sex" value = "nv" checked = "checked" /> <font color = "# 990000" size = "2" > Women </font> </td> </tr>
<! - a radio name was the same ->

struts2: action to set a variable called sex, and write it setSex () method, so that the action will be able to automatically receive the value of this radio.

Common jsp: String sex = request.getParameter ("sex");
bailu0420
2010-07-11 01:42:46

a step slow, huh. . . Positive Solutions
wdmzjshyx
2010-07-11 01:45:07
String val = request.getParameter ("sex1");
xiaodao820826
2010-07-11 01:49:59
you this does not work you should be consistent both name will be radio effect
cz19870901
2010-07-11 02:05:48
<tr> <td> <font color="#990000" size="2"> Gender: </font>
<td> <input type="radio" name="sex" value="nan"/> <font color = "# 990000" size = "2"> M </font>
<input type = "radio" name = "sex" value = "nv" checked = "checked" /> <font color="#990000" size="2"> Female </font> </td> </tr>
<! - a radio name was the same ->

struts2: action to set a variable called sex, and write it setSex () method, so that the action will be able to automatically receive the value of this radio.

ordinary jsp: String sex = request.getParameter ("sex");
kokoqiuyitian
2010-07-11 02:20:22
upstairs to get to the sex can only be "on"
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.