| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2009 人关注过本帖
标题:关于复选框无法全选和全选后数组的传递 和“详细”窗口打开代码出错
只看楼主 加入收藏
lukebc
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
结帖率:71.43%
收藏
已结贴  问题点数:10 回复次数:2 
关于复选框无法全选和全选后数组的传递 和“详细”窗口打开代码出错
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<html>
<head>
<script language=”javascript”>
<!--//
function chooseAll(multiChk){
for (var i=0;i<multiChk.length;i++)
{
multiChk[i].checked = true;
}
}
function reserveAll(oj){
var oj = document.all["shenhe"]; //注意把[]里的shenhe改为你的del

for(var i=0;i<oj.length;i++){
if(oj[i].checked == true)
oj[i].checked = false;
else oj[i].checked = true;
}
}
// -->
</script>

<link rel=stylesheet type=text/css href=asp.css>
 </head>
<body>
<table align="center" border="0">
<tr>
<td><!--#include file="top.asp"--></td>
</tr>
</table>


<table width="200"align="center" border="0">
<form id='shenhe'method="post" action="rkcx.asp"name="form1">
    <tr>
      <td colspan="6" align="center" bgcolor="#609B95"><strong>入 库 信 息 查 询</strong></td>
  </tr>
    <tr>
    <td width="100"><div align="center">编号</div></td>
    <td width="100"><div align="center">入库编号</div></td>
      <td width="100"><div align="center">材料名称</div></td>
    <td width="100"><div align="center">开始日期</div></td>
    <td width="100"><div align="center">结束日期</div></td>
    <td width="100"><div align="center">入库单位</div></td>
  </tr>
  <tr>
  <td><input name="bh" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
    <td><input name="rkbh" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input name="clmc" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input name="ksrq" class="wzjz "type="text" size="12" onFocus="this.value=''"></td>
  <td><input name="jsrq" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input name="drdw" class="wzjz" type="text" size="12" onFocus="this.value=''"></td>
  <td><input type="submit" name="rkc" value="查"></td>
  </tr>
  </form>
</table>
<%
dim i,intPage,page,pre,last,filepath
if request("rkc")="查" then
if request("bh")<>""then
if cond="" then
cond="编号 like '%" & trim(request("bh")) & "%'"
else
cond = cond & " AND 编号 like '%" & trim(request("bh")) & "%'"
end if
end if
if request("rkbh")<>""then
if cond="" then
cond="入库编号 like '%" & trim(request("rkbh")) & "%'"
else
cond = cond & " AND 入库编号 like '%" & trim(request("rkbh")) & "%'"
end if
end if
if request("clmc")<>"" then
If cond="" Then
cond="材料名称 like '%" & trim(request("clmc")) & "%'"
else
cond = cond & "and 材料名称 like '%" & trim(request("clmc")) & "%'"
end if
end if
if request("ksrq")<>"" then
if cond="" then
cond="日期>=# " & trim(request("ksrq")) & "#"
else
cond=cond & "and 日期>=# " & trim(request("ksrq")) & "#"
end if
end if
if request("jsrq")<>"" then
if cond="" then
cond="日期<=# " & trim(request("jsrq")) & "#"
else
cond=cond &"and 日期<=# " & trim(request("jsrq")) & "#"
end if
end if
if request("drdw")<>""then
if cond="" then
cond="调入单位 like '%" & trim(request("drdw")) & "%'"
else
cond = cond & " AND 调入单位 like '%" & trim(request("drdw")) & "%'"
end if
end if
if cond<>""then
sql="select * from 入库表 where " & cond & "order by 日期"
else
sql="select * from 入库表 order by 日期"
end if
session("sql")=(sql)
set rs=server.createobject("adodb.recordset")
        rs.PageSize = 10        

      rs.CursorLocation = 3

      rs.open sql,conn,1,1  

      pre = true

      last = true

      page = trim(Request.QueryString("page"))

      

      if len(page) = 0 then

                  intpage = 1

                  pre = false

      else

          if cint(page) =< 1 then

               intpage = 1

               pre = false

          else

              if cint(page) >= rs.PageCount then

                  intpage = rs.PageCount

                  last = false

              else

                   intpage = cint(page)

             end if

         end if

      end if

    if not rs.eof then

         rs.AbsolutePage = intpage

    end if
     
        response.write "<table border='1' align='center' cellpadding='1' cellspacing='1'>"
response.write "<tr>"
response.write " <th><input type='checkbox' name='shnehe' value='checkbox' onclick='chooseAll(document.all.shenhe)'><a href='javascript:chooseAll(document.all.shenhe)'>全选</a></th><th>编号</th> <th>入库编号</th> <th>日期</th> <th>材料名称</th> <th>型号规格</th> <th>入库数量</th> <th>计量单位</th> <th>调入单位</th> <th>备注</th> <th colspan='2'><a href='dc1.asp'>导出查询数据</a></th>"
response.write "</tr>"

        for i=1 to rs.PageSize

     if rs.EOF or rs.BOF then exit for

        %>
        <tr onMouseOver="this.bgColor='#99ccff'" onMouseOut="this.bgColor=''">
        <td><input name="shenhe" type="checkbox" id="shenhe" value="<%=rs("id")%>"></td>
        <td><input type="text" name="bh" class="xswb" readonly="true" size="12" value=<%=rs("编号")%>></td>
        <td><input type="text" name="rkbh" class="xswb" readonly="true" size="10" value=<%=rs("入库编号")%>></td>
        <td><input type="text" name="rq" class="xswb" readonly="true" size="10" value=<%=rs("日期")%>></td>
        <td><input type="text" name="clmc" class="xswb" readonly="true" size="12" value=<%=rs("材料名称")%>></td>
        <td><input type="text" name="xhgg" class="xswb" readonly="true" size="12" value=<%=rs("型号规格")%>></td>
        <td><input type="text" name="rksl" class="xswb" readonly="true" size="8" value=<%=rs("入库数量")%>></td>
        <td><input type="text" name="jldw" class="xswb" readonly="true" size="8" value=<%=rs("计量单位")%>></td>
        <td><input type="text" name="drdw" class="xswb" readonly="true" size="10" value=<%=rs("调入单位")%>></td>
        <td class="wzjz" height="22" width=50><a href="#"onClick="javascript:window.open('rkxx.asp?id=<%=rs("id")%>","","width=589,height=400")">祥细</a></td>
        <td class="wzjz" height="22" width=50><a href="rkxg.asp?id=<%=rs("id")%>">修改</a></td>
        <td class="wzjz" height="22" width=50><a onClick="return confirm('你确定要删除此记录吗?')" href="rksc_q.asp?id=<%=rs("id")%>">删除</a>
   </tr>
   <%
rs.MoveNext
next
   %>
     <tr>
      
     <%if rs.pagecount > 0 then%>

     <td class="wzjz" colspan="3">当前页<%=intpage%>/<%=rs.PageCount%>/共有记录<%=rs.recordcount%>条</td>

     <%else%>

    <td class="wzjz">当前页0/0</td><%end if%>

    <td class="wzjz" colspan="8"> <a href="rkcx.asp?page=1&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>">首页</a>|

     <%if pre then%>

     <a href="rkcx.asp?page=<%=intpage -1%>&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>">上页</a>| <%end if%>

     <%if last then%>

      <a href="rkcx.asp?page=<%=intpage +1%>&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>">下页</a> |<%end if%>

      <a href="rkcx.asp?page=<%=rs.PageCount%>&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>">尾页</a>|转到第

      <select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">

      <%

       for i = 1 to rs.PageCount

       if i = intpage then%>

       <option value="rkcx.asp?page=<%=i%>&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>" selected><%=i%></option>

     <%else%>

       <option value="rkcx.asp?page=<%=i%>&rkc=查&bh=<%=request("bh")%>&rkbh=<%=request("rkbh")%>&clmc=<%=request("clmc")%>&ksrq=<%=request("ksrq")%>&jsrq=<%=request("jsrq")%>&drdw=<%=request("drdw")%>"><%=i%></option>

        <%

          end if

        next

        %>

     </select>页</font>
      </td></tr>

   </table>

    <%rs.Close
    end if
    %>
<body>
</html>

1.以上的代码中全选的代码有什么问题
2.以上的代码“祥细”的代码有什么问题
3.如何将全选数据的传递到另一个页面,并行成sql语句
希望哪位高手邦我改一下,谢谢
搜索更多相关主题的帖子: javascript function include false file 
2015-03-22 12:49
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:5 
代码好长哟:
1-2有什么问题上机测试不就清楚了么?
3将查询的参数传递到另一个页面,然后再形成sql语句。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-03-27 16:59
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:5 
自己先试试
2015-03-28 07:32
快速回复:关于复选框无法全选和全选后数组的传递 和“详细”窗口打开代码出错 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028571 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved