不好意思,可能我没有说明白。比如我新增了一行,然后在”协议选择“这一列中输入cc,然后我想在右边的按钮中取到刚才输入的cc的值,怎么做?

解决方案 »

  1.   

    因为我是新增的行,所以协议选择下的输入框的name有些是一样的。
      

  2.   

    <script Language=JavaScript>
    function OpenWindows(url,widthx,heighx)
    {
      var 
     newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=20,left=60,width=400,height=400");
     return false;
     
    }
    function deleteLine()
    {
    for (var i=tbody1.children.length-1; i>=0 ; i-- )
    if (tbody1.children[i].firstChild.firstChild.checked)
    tbody1.deleteRow(i);
    }
    function addLine()
    {
    elm = thead1.lastChild.cloneNode(true)
    elm.style.display="block";
    tbody1.insertBefore(elm);
    }
    function gotoreg()
    {
    window.close();
    }function getThisRowInfo(obj)
    {
    alert("List_cardno:"+obj.parentElement.parentElement.all("List_cardno").value);
    alert("List_num:"+obj.parentElement.parentElement.all("List_num").value);
    }
    </script><html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>收件情况登记</title>
    </head><body bgcolor="#efefef" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><form action="recpt2.asp" method="post" name=myform onsubmit="return validate()">
      <table>
      <tr> 
          <td width="384"> 
            <table width="326" border="1">
              <thead id=thead1> 
              <tr> 
                <td width="20"> 
                  <div align="center">选中</div>
                </td>
                <td width="79"> 
                  <div align="center">抓包脚本</div>
                </td>
                <td width="78"> 
                  <div align="center">协议选择</div>
                </td>
                <td width="121"> 
                  <div align="center">备注</div>
                </td>
              </tr>
              <tr style="display:none"> 
                <td width="20"> 
                  <input type=checkbox id=checkLine name="checkbox" value="ON">
                </td>
                <td width="79"> 
                  <input name=List_cardno size=10 style="width: 60; height: 18">
                </td>
              <td width="78"> 
                  <input name=List_num size=10 style="width: 60; height: 18">
                </td>
              <td width="121"><input type="button" name="btn" value="AAA" onclick="getThisRowInfo(this);"> 
                </td>
              </tr>
              </thead> 
      <tbody id=tbody1> 
              <tr> 
                <td width="20"> 
                  <input type=checkbox id=checkLine name="checkbox" value="ON">
                </td>
                <td width="79"> 
                  <input name=List_cardno size=10 style="width: 60; height: 18">
                </td>
                <td width="78"> 
                  <input name=List_num size=10 style="width: 62; height: 18">
                </td>
              <td width="121"><input type="button" name="btn2" value="bbb" onclick="getThisRowInfo(this);"> 
                </td>
              </tr>
              </tbody> 
            </table>
            <input type=button onClick="deleteLine()" value=删除 name="button">
            <input type=button onClick="addLine()" value=添加 name="button">    
        <BR><BR>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    
          <input type="submit" value="确定" name="submit">
          &nbsp;&nbsp;&nbsp;&nbsp;    
          <input type="reset" value="取消">
        <div align="center"><br>    
      </div>    
      <div align="center">         
         
             
      </div>          
    </form>         
       
    </body>  
      

  3.   

    还要请教一下,如果我要对这些表格的数据存入数据库,改怎么写循环啊?(最好用jsp能不能给个例子啊)??谢谢
      

  4.   

    对不起,jsp不太熟,
    你可以到jsp论坛去问