| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 604 人关注过本帖
标题:这样传参如何实现?
只看楼主 加入收藏
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
结帖率:75%
收藏
 问题点数:0 回复次数:2 
这样传参如何实现?
加个判断:如果表格为第一行(即档位为1时)传递第一行表格参数,如果不为第一行,传递下一行参数,我该如何实现?[attach]68032[/attach]我的代码如下:

<link rel="stylesheet" href="../css/mm_travel2.css" type="text/css" />
<style type="text/css">
<!--
.STYLE6 {font-size: 24px}
.STYLE3 {color: #800000}
#Layer1 {
    position:absolute;
    left:11px;
    top:131px;
    width:148px;
    height:26px;
    z-index:1;
    visibility: visible;
}
#Layer2 {
    position:absolute;
    left:12px;
    top:162px;
    width:148px;
    height:26px;
    z-index:2;
    visibility: hidden;
}
#Layer3 {
    position:absolute;
    left:12px;
    top:190px;
    width:148px;
    height:26px;
    z-index:3;
    visibility: hidden;
}
#Layer4 {
    position:absolute;
    left:12px;
    top:218px;
    width:148px;
    height:26px;
    z-index:4;
    visibility: hidden;
}
#Layer5 {
    position:absolute;
    left:12px;
    top:246px;
    width:148px;
    height:26px;
    z-index:5;
    visibility: hidden;
}
.STYLE7 {font-size: 14px}
-->
</style>

<div id="Layer1" onclick="MM_showHideLayers('Layer2','','show','Layer3','','show','Layer4','','show','Layer5','','show')" ondblclick="MM_showHideLayers('Layer2','','hide','Layer3','','hide','Layer4','','hide','Layer5','','hide')">
  <div align="left" class="STYLE7">变压器</div>
</div>
<div id="Layer2">
  <div align="center">110KV</div>
</div>
<div id="Layer3">
  <div align="center">35KV</div>
</div>
<div id="Layer4">
  <div align="center">10KV</div>
</div>
<div id="Layer5">
  <div align="center">6KV</div>
</div>
<table width="1024" align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
  <!--DWLayoutTable-->
  <tr>
    <td height="90" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
    <td height="22" colspan="3" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr>
    <td width="150" height="757" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="22" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
    <td width="852" valign="top">
       <table width="100%" border="0" cellpadding="0" cellspacing="0">
         <form name="form1" method="post" action="wucha.asp">
           <!--DWLayoutTable-->
           <tr>
             <td height="32" colspan="3" valign="top"><div align="center" class="STYLE6">变压器试验报告</div></td>
        <tr>
          <td height="479" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
            <!--DWLayoutTable-->
            <tr>
              <td width="852" height="476" valign="top"><table width="100%" border="1" align="center" style="border-collapse: collapse">
                <!--DWLayoutTable-->
                <tr>
                  <td colspan="5">直流电阻测试</td>
                      </tr>
                <tr>
                  <td colspan="5">高压侧</td>
                      </tr>
                <tr>
                  <td width="105">档位</td>
                        <td width="187">A0</td>
                        <td width="187">B0</td>
                        <td width="187">C0</td>
                        <td width="152">误差</td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="1" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="2" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="3" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="4" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="5" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="6" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="7" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="8" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="9" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="10" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="10" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="12" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="13" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="14" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="15" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="16" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="17" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="18" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
               
                <tr>
                  <td><input name="gdangw" type="text" id="gdangw" value="19" size="15" /></td>
                        <td><input name="gya0" type="text" id="gya0"  size="15" /></td>
                        <td><input name="gyb0" type="text" id="gyb0"  size="15" /></td>
                        <td><input name="gyc0" type="text" id="gyc0"  size="15" /></td>
                        <td><input name="gwuc" type="text" id="gwuc"  size="15" /></td>
                      </tr>
                </table></td>
                </tr>
            
            

            
            
                              </table></td>
          </tr>
        <tr>
          <td width="361" height="2"></td>
          <td width="86"></td>
          <td width="405"></td>
        </tr>
        <tr>
          <td height="152" colspan="3" valign="top">              <table width="100%" border="1" align="center" style="border-collapse: collapse">
            <!--DWLayoutTable-->
            
            <tr>
              <td height="17" colspan="5" valign="top">中压侧</td>
                </tr>
            
            
            <tr>
              <td width="105" height="17" valign="top"><label>档位</label></td>
                  <td width="187" valign="top">A0</td>
                  <td width="187" valign="top">B0</td>
                  <td width="187" valign="top">C0</td>
                  <td width="152" valign="top">误差</td>
                </tr>
            
            <tr>
              <td height="20" valign="top"><input name="zdangw" type="text" id="zdangw" value="1" size="15" /></td>
                  <td valign="top"><input name="zya0" type="text" id="zya0" size="15" /></td>
                  <td valign="top"><input name="zyb0" type="text" id="zyb0" size="15" /></td>
                  <td valign="top"><input name="zyc0" type="text" id="zyc0" size="15" /></td>
                  <td valign="top"><input name="zwuc" type="text" id="zwuc" size="15" /></td>
                </tr>
            <tr>
                <td height="20" valign="top"><input name="zdangw" type="text" id="zdangw" value="2" size="15" /></td>
                <td valign="top"><input name="zya0" type="text" id="zya0" size="15" /></td>
                <td valign="top"><input name="zyb0" type="text" id="zyb0" size="15" /></td>
                <td valign="top"><input name="zyc0" type="text" id="zyc0" size="15" /></td>
                <td valign="top"><input name="zwuc" type="text" id="zwuc" size="15" /></td>
              </tr>
            <tr>
                <td height="20" valign="top"><input name="zdangw" type="text" id="zdangw" value="3" size="15" /></td>
                <td valign="top"><input name="zya0" type="text" id="zya0" size="15" /></td>
                <td valign="top"><input name="zyb0" type="text" id="zyb0" size="15" /></td>
                <td valign="top"><input name="zyc0" type="text" id="zyc0" size="15" /></td>
                <td valign="top"><input name="zwuc" type="text" id="zwuc" size="15" /></td>
              </tr>
            <tr>
                <td height="20" valign="top"><input name="zdangw" type="text" id="zdangw" value="4" size="15" /></td>
                <td valign="top"><input name="zya0" type="text" id="zya0" size="15" /></td>
                <td valign="top"><input name="zyb0" type="text" id="zyb0" size="15" /></td>
                <td valign="top"><input name="zyc0" type="text" id="zyc0" size="15" /></td>
                <td valign="top"><input name="zwuc" type="text" id="zwuc" size="15" /></td>
              </tr>
            <tr>
                <td height="20" valign="top"><input name="zdangw2" type="text" id="zdangw2" value="5" size="15" /></td>
                <td valign="top"><input name="zya0" type="text" id="zya0" size="15" /></td>
                <td valign="top"><input name="zyb0" type="text" id="zyb0" size="15" /></td>
                <td valign="top"><input name="zyc0" type="text" id="zyc0" size="15" /></td>
                <td valign="top"><input name="zwuc" type="text" id="zwuc" size="15" /></td>
              </tr>
            
                                          </table></td>
          </tr>
        <tr>
          <td height="67" colspan="3" valign="top">
            <table width="100%" border="1" align="center" style="border-collapse: collapse">
              <!--DWLayoutTable-->
              <tr>
                <td width="105" rowspan="2">低压侧</td>
                  <td width="187">AB</td>
                  <td width="187">BC</td>
                  <td width="187">CA</td>
                  <td width="152">误差</td>
                </tr>
              <tr>
                <td><input name="dya0" type="text" class="STYLE3" id="dya0" size="15" /></td>
                  <td><input name="dyb0" type="text" class="STYLE3" id="dyb0" size="15" /></td>
                  <td><input name="dyc0" type="text" class="STYLE3" id="dyc0" size="15" /></td>
                  <td><input name="dwuc" type="text" class="STYLE3" id="dwuc" size="15" /></td>
                </tr>
              <tr>
                <td>试验结论</td>
                  <td colspan="4"><input type="text" size="15" /></td>
                  </tr>
            </table></td>
        </tr>
        <tr>
          <td height="25" valign="top"><label>
              <input type="submit" name="Submit" value="提交" />
            </label></td>
        <td>&nbsp;</td>
          <td valign="top"><a href="editbyq110_2.asp">下一页</a> <a href="edit.asp">上一页</a></td>
        </tr>
        </form>
       </table></td>
  </tr>
</table>
图片附件: 游客没有浏览图片的权限,请 登录注册


[ 本帖最后由 ashimaxigo 于 2013-1-13 21:14 编辑 ]
搜索更多相关主题的帖子: visible position absolute 表格 
2013-01-13 14:49
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
收藏
得分:0 
中压测部分代码可以先不管他,先看高压侧部分。写入数据库的代码是这样的:
<%@language=vbscript%>
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from zhizgy"
rs.open sql,conn,1,3
dim nMax,nMin,a,b,c,n,n1,n2,s,i
       a=request("gya0")
       b=request("gyb0")
       c=request("gyc0")
       gdangw=request("gdangw")

       nMax=a
       nMin=a           
       if (a>b) and (b>c)then
           nMax=a
           nMin=c
           end if
      
       if (a>c) and (c>b)then
           nMax=a
           nMin=b
       end if
      
       if (b>a) and (a>c)then
           nMax=b
           nMin=c
       end if
      
       if (b>c) and (c>a)then
           nMax=b
           nMin=a
       end if
      
       if (c>a) and (a>b)then
           nMax=c
           nMin=b
       end if
      
       if (c>b) and (b>a)then
           nMax=c
           nMin=a
       end if
      
       if (a=b) and (a>c)then
           nMax=a'也等于b
           nMin=c
       end if
       if (a=b) and (a<c)then
           nMax=c
           nMin=a
       end if
      
       if (b=c) and (b>a)then
           nMax=b'也等于c
           nMin=a
       end if
       if (b=c) and (b<a)then
           nMax=a
           nMin=b
       end if
      
       if (c=a) and (c>b)then
           nMax=c'也等于a
           nMin=b
       end if
       if (c=a) and (c<b)then
           nMax=b
           nMin=c
       end if
      
       if (a=b) and (b=c)then
           s=0
       end if
      s=((nMax-nMin)/nMin)
      's = Round(s, 2)
      's=formatnumber(s,2)
    rs.addnew
    rs("gya0")=a
    rs("gyb0")=b
    rs("gyc0")=c
    rs("gwuc")=s
    rs("gdangw")=gdangw
    rs.update
    rs.movenext

    end if
%>


2013-01-13 14:58
ashimaxigo
Rank: 2
等 级:论坛游民
帖 子:29
专家分:17
注 册:2012-12-24
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册
这是数据库主要字段
2013-01-13 15:00
快速回复:这样传参如何实现?
数据加载中...
 
   



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

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