答案:<style>
p,div,body,td,input,checkbox,button{font-size:9pt;}
</style>
<script language="vbScript">
function vbtrim(str)
vbtrim=trim(str)
end function
function vbisnumeric(iVar)
vbisnumeric=not isnumeric(iVar)
end function
</script>
<script language="javascript">
<!--
var chkval=new Array();
var curstr =0;
function checktable()
{
if(typeof(form1.wtfs.length)=="undefined") alert('数目不够,无法继续。'); // One Checkbox err
wtab.style.visibility="visible"; // display table
var wtfsmc="";
chkval[curstr]="";
for(i=0;i<form1.wtfs.length;i++)
{
if (form1.wtfs[i].checked)
{
wtfsmc+=vbtrim(form1.wtfs[i].nextSibling.nodeValue)+",";
chkval[curstr]+=vbtrim(form1.wtfs[i].value)+",";
form1.wtfs[i].checked=false;
form1.wtfs[i].disabled=1;
}
}
if (wtfsmc!="")
{ wtfsmc=wtfsmc.substring(0,wtfsmc.length-1)
chkval[curstr]=chkval[curstr].substring(0,chkval[curstr].length-1)
addtr(wtfsmc,curstr);
curstr++;
}
}
function addtr(mc,iIndex)
{
//wtfsmc=obj.nextSibling.nodeValue; // checkbox后面的文字
iRow=wtab.rows.length;
if (iRow==1) // xuhao value
{
xuhao=1
}
else
{
xuhao=parseInt(wtab.rows[iRow-1].cells[0].innerText)+1;
}
if (form1.ynlj.checked) // 是否
{
shifou="<font color=green>是</font>";
}
else
{
shifou="<font color=blue>否</font>";
}
czuo="[ <a href=> myNewRow =wtab.insertRow(); // insert TR row
for (j=0; j <wtab.rows(iRow-1).cells.length; j++)
{
myNewCell = wtab.rows[iRow].insertCell(j) ; // insert TD cecll of TR collection
switch(j)
{
case 0:
wtab.rows[iRow].cells(j).innerHTML = xuhao+" "; wtab.rows[iRow].cells(j).align="right";
break;
case 1:
wtab.rows[iRow].cells(j).innerHTML = " "+mc; wtab.rows[iRow].cells(j).align="left";
break;
case 2:
wtab.rows[iRow].cells(j).innerHTML =" "+ shifou; wtab.rows[iRow].cells(j).align="left";
break;
case 3:
wtab.rows[iRow].cells(j).innerHTML = czuo; wtab.rows[iRow].cells(j).align="center";
wtab.rows[iRow].cells(j).attachEvent ('onmouseover',SetColor_1);
wtab.rows[iRow].cells(j).attachEvent ('onmouseout', SetColor_2);
break;
}<
上一个:给你一个js(转自51js)
下一个:动态增加表单元素