请教如何得到我动态增加的表格的值,请看代码如下 不好意思,可能我没有说明白。比如我新增了一行,然后在”协议选择“这一列中输入cc,然后我想在右边的按钮中取到刚才输入的cc的值,怎么做? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 因为我是新增的行,所以协议选择下的输入框的name有些是一样的。 <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> <input type="submit" value="确定" name="submit"> <input type="reset" value="取消"> <div align="center"><br> </div> <div align="center"> </div> </form> </body> 还要请教一下,如果我要对这些表格的数据存入数据库,改怎么写循环啊?(最好用jsp能不能给个例子啊)??谢谢 对不起,jsp不太熟,你可以到jsp论坛去问 JS+CSS 定时文字切换效果 同一页面 放N个 正則 还要请教那高手! 复选框的问题请教,多谢赐教! 为什么显示不出来width的值???请教........... 求助!表格加入一行后,如何使加入的行可以编辑? 救命!!!如何在一个窗口关闭前要提出确认,如果yes,就关闭窗口,如果no,就不关窗口 簡單,送分,這兩句是什麼意思? 急需帮助,网页设计中插件是什么意思呀? 有没有类似MySQL客户端的在线编辑器? 关于cookie的问题(急) 怎么打印页面中的iframe页的内容呢
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>
<input type="submit" value="确定" name="submit">
<input type="reset" value="取消">
<div align="center"><br>
</div>
<div align="center">
</div>
</form>
</body>
你可以到jsp论坛去问