一个比较烦人的脚本控制功能,请大家发表意见 没有什么捷径吧,技巧在于你的TEXT NAME了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把text的name用二维数组表示,然后做循环 将text放入表格中,然后循环计算该表中的text!因为很容易通过td获取其中的text<table id=tab1><tr><td><input type=text></td><td><input type=text></td></tr><tr><td><input type=text></td><td><input type=text></td></tr></table><script>var oTR = oTD = null;for(var iRow = 0; iRow < tab1.rows.length; iRow++){ oTR = tab2.rows(i); for(var iCol = 0; iCol < oTR.cells.length; iCol++){ oTD = oTR.childNodes(0); oInput = oTD.childNodes(0); // 进行oInput.value 的操作 }}</script> Sorry! :( oTR = tab2.rows(i); == > oTR = tab2.rows(iRow); oTD = oTR.childNodes(0); == > oTD = oTR.childNodes(iCol); function showtotal1(txt1,txt2,txt3,txt4,txt5,txt6,txt7,txt8,txt9){ document.getElementById(txt9).value=parseInt(document.getElementById(txt1).value)+parseInt(document.getElementById(txt2).value)+parseInt(document.getElementById(txt3).value)+parseInt(document.getElementById(txt4).value)+parseInt(document.getElementById(txt5).value)+parseInt(document.getElementById(txt6).value)+parseInt(document.getElementById(txt7).value)+parseInt(document.getElementById(txt8).value); var count=0; if(document.expense_applymodify.hid.length>0) { for(var i=0;i<document.expense_applymodify.hid.length;i++) { var index=2; index=index+i; count+=eval(document.all('DataGrid1__ctl'+index+'_totals').value); } } else { count+=eval(document.all('DataGrid1__ctl2_totals').value); } document.expense_applymodify.allmoney.value=count;} Id为定义 Name未定义 js能不能弄二进制数据? javascript 解析 XML ext 的VTypes...................... 还是老问题 json.js问题!高手进!(200分) 求助:越简单越好,顶者有分!!! js页面样式 急需要 如何改变文本框输入值的文字分区显示 confirm框的返回值 模板UTF转换成GBK后出现的问题 求助 框架网页中页面自动刷新的问题 如何通过JS来控制打印机的横向设置呢?
因为很容易通过td获取其中的text<table id=tab1>
<tr><td><input type=text></td><td><input type=text></td></tr>
<tr><td><input type=text></td><td><input type=text></td></tr>
</table><script>
var oTR = oTD = null;
for(var iRow = 0; iRow < tab1.rows.length; iRow++){
oTR = tab2.rows(i);
for(var iCol = 0; iCol < oTR.cells.length; iCol++){
oTD = oTR.childNodes(0);
oInput = oTD.childNodes(0);
// 进行oInput.value 的操作
}
}
</script>
oTD = oTR.childNodes(0); == > oTD = oTR.childNodes(iCol);
{
document.getElementById(txt9).value=parseInt(document.getElementById(txt1).value)+parseInt(document.getElementById(txt2).value)+parseInt(document.getElementById(txt3).value)+parseInt(document.getElementById(txt4).value)+parseInt(document.getElementById(txt5).value)+parseInt(document.getElementById(txt6).value)+parseInt(document.getElementById(txt7).value)+parseInt(document.getElementById(txt8).value);
var count=0;
if(document.expense_applymodify.hid.length>0)
{
for(var i=0;i<document.expense_applymodify.hid.length;i++)
{
var index=2;
index=index+i;
count+=eval(document.all('DataGrid1__ctl'+index+'_totals').value);
}
}
else
{
count+=eval(document.all('DataGrid1__ctl2_totals').value);
}
document.expense_applymodify.allmoney.value=count;
}