单选框(radio)的取值不是直接点击,相同名字的单选框要建一个数组分别赋值
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
function checkid(chk){
var i=0;
var id=0;
for(i=0;i<chk.length;i++){
if(chk[i].checked==true)
{
alert(chk[i].value);
id=chk[i].value;
}
}
alert(id);
}
</script>
</head>
<body>
<form name="checkidaaa" method="post">
<table>
<tr><td>
<input name="aaa" type="radio" value="a" checked="checked" />111
<input name="aaa" type="radio" value="b" />222
<input name="aaa" type="radio" value="c" />333</td></tr>
<tr><td>
<input name="bbb" type="button" οnclick="checkid(aaa);" value="提交"/>
</td></tr></table>
</form>
</body>
</html>