Chinaunix
標(biāo)題: 處理頁面里table單元格數(shù)值 [打印本頁]
作者: sdwjian 時(shí)間: 2011-12-20 09:48
標(biāo)題: 處理頁面里table單元格數(shù)值
function SetUrlll(action) {
var objTable = document.getElementById("DataGrid1");//("tb"+tbid)是表格的ID號,用<table id=XXX ...>定義的那個XXX
var rowscount = objTable.rows.length;//取表格的總行數(shù)
var check = 0;//計(jì)數(shù)器
for (var i=rowscount-1;i>=0;i--)
{
if (objTable.rows[i].childNodes(7).childNodes(0).checked==true)
{
check++;
//alert(objTable.rows[i].childNodes(8).childNodes(0).value);
//alert(objTable.rows[i].childNodes(7).childNodes(0).value);
objTable.rows[i].childNodes(7).childNodes(0).value=objTable.rows[i].childNodes(7).childNodes(0).value+objTable.rows[i].childNodes(8).childNodes(0).value;
alert(objTable.rows[i].childNodes(7).childNodes(0).value);
}
}
if ((check<5) || (check>50))
{
alert("請每次提交10-50份單證! ");
}
else
{
document.MyForm.action="fj_save.asp";
document.MyForm.method="post";
document.MyForm.submit();
return;
}
}
歡迎光臨 Chinaunix (http://72891.cn/) |
Powered by Discuz! X3.2 |