Get the value of radio radio

Category: Web Develop
 
xndr1314
2013-08-20 05:55:28

Sponsored Links
Made a modified page, according to the ID, ID can not be modified, modify the entry: Name, age, gender;
male <input type = "radio" value = "<% = u.getSex ()%>" name = "sex">
female <input type = "radio" value = " <% = u.getSex ()%> "name =" sex ">

name and age can be modified, with the all TXT input can be modified but I have sex with the radio can not be modified without the menu box if you do not fill in the database is displayed null

using FORM form submission
<% User u = (User) request.getAttribute ("users");%> / / get User parameters
<form action = "update.do? id = <% = u.getId ()%>" method = "post">
people look up solutions of

Sponsored Links

aeryi
2013-08-20 06:05:36
M <input type = "radio" value = "M" name = "sex" id = "sex1">
female <input type="radio" value=" " name="sex" id="sex2">

<script>
var old = "<% = u.getSex ()%>";
if (old = = "M") {
document.getElementById ("sex1"). checked = true;
} else if (old == "female") {
document.getElementById ("sex2"). checked = true;
}
</script>
wang1986442
2013-08-20 06:13:19
judgment, if it is male display

M <input type="radio" checked="true" name="sex">
female <input type = " radio "checked =" false "name =" sex ">

else

male <input type =" radio " ; checked = "flase" name = "sex">
female <input type = "radio" checked = "true" name = "sex" >
zdd1018
2013-08-20 06:15:53
. . . . . Zenong. . . I must add in tabular form method statement?
phaq99
2013-08-20 06:24:43
You two are the same single marquee value, that value is the original, of course, can not modify!
hasuper
2013-08-20 06:32:05
two buttons where you want to take what value he took what value ...... or js
qiuyu817
2013-08-20 06:49:14
Thank tests can be used
WSYJY
2013-08-20 07:05:43
landlord wanted to modify the time point when entering the page to modify the initial value of each attribute it
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.