网页错误:缺少对象/'null'为空或不是对象
主要问题是:1、选了某些checkbox后,按删除,不能删除,提示"网页上有错误"--'null'为空或不是对象
2、勾了“全部选择/取消”复选框,不执行全选功能,也提示"网页上有错误"--缺少对象
代码如下:(望好心人解答,或给点提示,太感谢了!)
<!--#include file="conn.inc"-->
<html>
<head>
<script language="javascript">
function editit(id)
{
page="adminhouseedit.asp?id="+id
window.open (page,'查看编辑题目','width=560,height=360')
}//编辑题目弹出固定大小的窗口
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}//选择题目
function viewit(myform)
{
if (document.viewaddform.subjectview.value!="")
subject=document.viewaddform.subjectview.value;
else
subject="所有";
if (document.viewaddform.typeadd.value!="")
type=document.viewaddform.typeadd.value;
else
type="所有";
result="浏览<"+subject+">题库中<"+type+">题目?"
if (confirm(result))
{
myform.action="adminhouse.asp";
myform.submit();
}
}
function searchit(myform)
{
if (document.viewaddform.subjectview.value!="")
subject=document.viewaddform.subjectview.value;
else
subject="所有";
if (document.viewaddform.typeadd.value!="")
type=document.viewaddform.typeadd.value;
else
type="所有";
if (document.viewaddform.mykey.value!="--关键字--")
mykey=document.viewaddform.mykey.value;
else
mykey="";
result="在<"+subject+">题库中<"+type+">题目中搜索关键字<"+mykey+">?"
if (confirm(result))
{
myform.action="adminhouse.asp";
myform.submit();
}
}//按照关键字查找
function addit(myform)
{
if (document.viewaddform.subjectview.value!="" & document.viewaddform.typeadd.value!=""){
result="添加"+document.viewaddform.typeadd.value+"题目到"+document.viewaddform.subjectview.value+"题库?"
if (confirm(result))
{
myform.action="adminhouseadd.asp";
myform.submit();
}
}
else
alert("请首先选择科目和题目类型")
}//添加题目
function delit(myform)
{
if (confirm ("是否从题库中删除所选项?"))
{
window.location="adminhousedel.asp";
<!-- myform.action="adminhousedel.asp"; -->
myform.submit();
}
}//删除题目
</script>
<link rel="stylesheet" type="text/css" href="mycss.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body>
<table border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2" height="25">
<tr>
<td width="100%">当前位置:<a href="news.asp">系统管理</a> > 题库管理</td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" id="AutoNumber2" bgcolor="#E1E1E1" width="100%">
<form name="viewaddform" meth