高分请,高手来看,如何获得动态表格中的输入框的值

来源:百度知道 编辑:UC知道 时间:2024/06/21 05:08:37
<script language="javascript">
function findObj(theObj, theDoc)
{
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObjtheObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}
//添加一个参与人填写行
function AddSignRow(){ //读取最后一行的行号,存放在txtTRLastIndex文本框中
var txtTRLastIndex = findObj("txtTRLastIndex",document);

在HTML中使用的话当然有区别的。<script language="javascript" src=""></script>用的脚本javascript。<!--#include file=""-->这样这个代码根本没有任何意义,因为HTML中这个用<!--内容-->括起来的内容相当于注释。如果想包含文件,可以用
<SCRIPT language=JavaScript src="wenjian.asp"></SCRIPT>
或者用
<iframe name="about" width="660" height="500" src="wenjian.asp" frameborder="0" noresize></iframe>

script language="javascript" src="news.asp"></script>和<!--#include file="news.asp"-->实现的功能是不是一样?并且前者还可以<script language="javascript" src="news.asp?id=''"></script>这样使用.....
不一样,一个是调用JS,一个是声明。根本就是不同的两个东西。
可以那样用。。。

if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0