大家有没有遇到过这样的情况
<html>
<head>
<title></title>
<script language="JavaScript">
function checkChecked(str){
var val=""
if(document.form1.check){
if(document.form1.check.length>=0){
flag=true;
for(i=0;i<document.form1.check.length;i++){
if(document.form1.check[i].checked){
if (flag){
val=val+document.form1.check[i].value
}else{
val=val+","+document.form1.check[i].value
}
flag=false;
}
}
}
else{
if(document.form1.check.checked)
flag=false;
}
if(flag){
alert("至少有一个被选中!")
return false;
}
}
if(document.form1.submit1.value=="修改"){
document.form1.action="zyxm_jzhadd.asp?title=修改重要项目进展报告&act=1&zyxm_time="+val+"&zyxm_id="+str
document.form1.submit();
}else{
document.form1.action="zyxm_jzhadd.asp?title=删除重要项目进展报告&act=2&zyxm_time="+val+"&zyxm_id="+str
if(confirm('确定要删除吗?')){
document.form1.submit();
}
}
}
</script>
</head>
<body>
<input type="radio" name="check" value="<%=xm_rs("id")%>">
</body>
</html>
当页面上只有一条记录时,得不到val的值