一个审核问题!
<script language="javascript">
function AreaWin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=400,height=300";
var AreaWin=window.open(url,"AreaWin",oth);
AreaWin.focus();
return false;
}
function SELECTChk()
{
var s=false;
var auto_id,n=0;
var strid,strurl;
var nn = self.document.all.item("area")
for (j=0;j<nn.length;j++)
{
if (self.document.all.item("area",j).checked)
{
n = n + 1;
s=true;
auto_id = self.document.all.item("area",j).id+"";
if(n==1)
{
strid = auto_id;
}
else
{
strid = strid + "," + auto_id;
}
}
}
strurl = "paicheng_Delt.asp?id=" + strid;
if(!s){
alert("请选择要删除的排程!");
return false;
}
if ( confirm("你确定要删除这些排程吗?")) {
form1.action = strurl;
form1.submit();
}
}
function SELECTChk1()
{
var s=false;
var auto_id,n=0;
var strid,strurl;
var nn = self.document.all.item("area")
for (j=0;j<nn.length;j++)
{
if (self.document.all.item("area",j).checked)
{
n = n + 1;
s=true;
auto_id = self.document.all.item("area",j).id+"";
if(n==1)
{
strid = auto_id;
}
else
{
strid = strid + "," + auto_id;
}
}
}
strurl = "paicheng_checked.asp?id=" + strid;
if(!s){
alert("请选择要审核的排程!");
return false;
}
if ( confirm("你确定要审核这些排程吗?")) {
form1.action = strurl;
form1.submit();
}
}
function sltAll()
{
var nn = self.document.all.item("area");
for(j=0;j<nn.length;j++)
{
self.document.all.item("area",j).checked = true;
}
}
function sltNull()
{
var nn = self.document.all.item("area");
for(j=0;j<nn.length;j++)
{
self.document.all.item("area",j).checked = false;
}
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form id="form1" name="form1" method="POST">
<%
Dim rs
Set rs = Server.CreateObject("ADODB.RecordSet")
%>
<p align=center><font style='FONT-SIZE:12pt' color="#000080"><b>排 程 管 理</b></font></p>
<p align="center">
<%
Response.Write" <a href=""paicheng_tj.asp"">继续添加</a> "
Response.Write" <a href=""index.asp"">返回首页</a> "
Response.Write" <a href=""logout.asp"" >退出系统</a> "
%>
</p>
<table align=center border="1" cellspacing="0" width="88%" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF">
<tr>
<td width="20%" align="center" bgcolor="#BEDCFA"><strong>部门</strong></td>
<td width="10%" align="center" bgcolor="#BEDCFA"><strong>日期</strong></td>
<td width="35%" align="center" bgcolor="#BEDCFA"><strong>会议主题</strong></td>
<td width="15%" align="center" bgcolor="#BEDCFA"><strong>时间</strong></td>
<td width="10%" align="center" bgcolor="#BEDCFA"><strong>地点</strong></td>
<td width="5%" align="center" bgcolor="#BEDCFA"><strong>修改</strong></td>
<td width="5%" align="center" bgcolor="#BEDCFA"><strong>选择</strong></td>
</tr>
<%
'读取并显示个人排程
if Session("pass_userid")="002140" OR Session("pass_userid")="W1064" then
sqlType1 = "SELECT top 50 * FROM gspaicheng where pc_check=0 order by pc_date "
else
sqlType1 = "SELECT top 50 * FROM gspaicheng where pc_check=0 and pc_userid='"&Session("pass_userid")&"' order by pc_date "
end if
rs.Open sqlType1, Conn, 1, 1
%>
<tr>
<%
Do While Not rs.EOF
%>
<td align="center" ><%=rs("pc_department")%> <%=rs("pc_department1")%> </td>
<td align="center"><%=rs("pc_date")%> </td>
<td align="center"><%=rs("pc_title")%> </td>
<td align="center"><%=rs("pc_time")%>-<%=rs("pc_time1")%> </td>
<td align="center"><%=rs("pc_site")%> </td>
<td align="center"><a href="paichen_Edit.asp?id=<%=rs("auto_id")%>" onClick="return AreaWin(this.href)">修改</a></td>
<td align="center"><input type="checkbox" name="area" id="<%=rs("auto_id")%>" style="font-size: 9pt"></td></tr>
<%
rs.MoveNext()
Loop
%>
</table>
<p align="center">
<input type="button" value="全 选" onClick="sltAll()" name=button1>
<input type="button" value="清 空" onClick="sltNull()" name=button2>
<input type="submit" value="删 除" name="tijiao" onClick="SELECTChk()">
<% if Session("pass_userid")="002140" OR Session("pass_userid")="W1064" then
response.Write " <input type='submit' value='审 核' name='shenghe' onClick='SELECTChk1()'>"
end if
%>
<br><br>
勾选 审核或者删除的时候 提示说"请选择要审核的排程!" 以前用了两年一直都好好的,现在一直都这样,无语,找不到原因,请高手指点?? 是你的type=submit的关系么
[解决办法]
你有 input type="checkbox" name="area"...
var nn = self.document.all.item("area") //得到所有名为 area 的复选框
for (j=0;j<nn.length;j++)
{
if (self.document.all.item("area",j).checked) //这里就不能这么写了
if (nn[j].checked) //要这样写