请大家帮我看看我的复选框判断~没头绪了~谢谢了
我这是图书馆查询页面,里面有复选框和单选按钮,查询提交时无论单选或多选至少选一个,就是如果不选单选就要有一个复选,如果复选不选就要有一个单选~代码如下:
<%@LANGUAGE= "VBSCRIPT " CODEPAGE= "936 "%>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 书籍查询 </title>
<link href= "css/yangshi.css " rel= "stylesheet " type= "text/css ">
<style type= "text/css ">
<!--
.style8 {color: #FF0000}
-->
</style>
<script language= "javascript ">
function checkvalue(theform)
{
for(j=0;j <theform.checkbox.length;j++)
if(theform.checkbox(i).checked==true)
{
break;
}
for(i=0;i <theform.radiobutton.length;i++)
if (theform.radiobutton[i].checked==true)
{
break;
}
if (i==theform.radiobutton.length)
{
alert( "您没选择任何查询项目 ");
return false;
}
return (true);
}
</script>
<!--#include file= "top.asp "-->
<table width= "75% " border= "0 " align= "center ">
<tr>
<td height= "27 " class= "style4 "> <div align= "center "> 书目查询 </div> </td>
</tr>
</table>
<table width= "75% " border= "0 " align= "center ">
<tr>
<td> <span class= "style1 "> </span> 在这里,您可以对 </span> <span class= "style8 "> 本馆图书 </span> 进行分类及详细查询 </td>
</tr>
</table>
<form name= "form1 " method= "post " action= "ac_booksearch.asp " >
<table width= "68% " height= "232 " border= "0 " align= "center ">
<tr>
<td colspan= "2 " > <span class= "style6 "> 1.请选择查询路径 </span> </td>
</tr>
<tr >
<td width= "15% "> </td>
<td width= "85% " > <input name= "radiobutton " type= "radio " value= "1 ">
<span class= "style7 "> 编号 </span>
<span class= "style7 "> <input name= "booknum " type= "text " id= "booknum ">
&n