请问在增加列时 怎么才能够增加复选框 和前3个一样 怎么判断呢<script language="javascript" type="text/javascript">
function InsertCol(obj){ //插入列
var oTd
for(j=0;j<obj.rows.length;j++){
oTd=obj.rows(j).insertCell(obj.rows(j).cells.length);
alert(obj.rows(j).cells(0));
oTd.innerHTML='<input type="text" />';
}
}
function DeleteCol(obj){ //删除列
for(j=0;j<obj.rows.length;j++)
{
if(obj.rows(j).cells.length>4)
{
obj.rows(j).deleteCell(obj.rows(j).cells.length-1);
}
}
}
</script>
<td align="right"><input name="addv_btn" id="addv_btn" type="button" class="button" onClick="InsertCol(delegateInfor3);" value="增加列" />
<input name="del_btn" id="del_btn" type="button" class="button" onClick="DeleteCol(delegateInfor3)" value="删除行" /> <TABLE id="delegateInfor3" width="100%"
border="1" align="center" cellpadding="0" cellspacing="0"
bordercolor="#CCCCCC">
<tr>
<td width="100" height="20" align="center"> </td>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
</tr>
<tr>
<td width="100" height="20" align="center">序号 </td>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级类型 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级公司 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">级别 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">编号 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
</table>
function InsertCol(obj){ //插入列
var oTd
for(j=0;j<obj.rows.length;j++){
oTd=obj.rows(j).insertCell(obj.rows(j).cells.length);
alert(obj.rows(j).cells(0));
oTd.innerHTML='<input type="text" />';
}
}
function DeleteCol(obj){ //删除列
for(j=0;j<obj.rows.length;j++)
{
if(obj.rows(j).cells.length>4)
{
obj.rows(j).deleteCell(obj.rows(j).cells.length-1);
}
}
}
</script>
<td align="right"><input name="addv_btn" id="addv_btn" type="button" class="button" onClick="InsertCol(delegateInfor3);" value="增加列" />
<input name="del_btn" id="del_btn" type="button" class="button" onClick="DeleteCol(delegateInfor3)" value="删除行" /> <TABLE id="delegateInfor3" width="100%"
border="1" align="center" cellpadding="0" cellspacing="0"
bordercolor="#CCCCCC">
<tr>
<td width="100" height="20" align="center"> </td>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
<TD><input type="checkbox" class="check" onclick="ccolor()" name="checkItem"></TD>
</tr>
<tr>
<td width="100" height="20" align="center">序号 </td>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级类型 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">评级公司 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">级别 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
<tr>
<td width="100" height="20" align="center">编号 </td>
<TD><input type="text" name="infoValue_txt2" id="infoValue_txt2" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
<TD><input type="text" name="infoValue_txt1" id="infoValue_txt1" /></TD>
</tr>
</table>
解决方案 »
- JavaScript如何获得某一天的前一天日期
- web开中使用谷歌地图的几个问题
- select 美化,并且能把先定的值通过FORM传到变量里
- 使用Javascript能实现操作Domino对象收发邮件吗?(很具有挑战性的问题)
- 求正则, 至少有一个非空白字符, 总长不超过 25
- 拖拽实践
- 如何触发文本框的值改变的事件?
- 我的链接<a href="index.htm">HOME</a>,当鼠标移到HOME上面时,我不希望出现虚线框,怎么办?
- 请问,如何获取窗体控件的名称?{我不知道该控件的ID}
- 小妹求助各位大哥!
- 请高手解答:弹出一个层屏蔽其它所有层,背景能随滚动条加载(急!在线等)
- 怎样调用上页里的JS代码????
var oTd
for(j=0;j<obj.rows.length;j++){
oTd=obj.rows(j).insertCell(obj.rows(j).cells.length);
alert(obj.rows(j).cells(0));
if(j==0)
{
oTd.innerHTML=obj.rows(0).cells(1).innerHTML;
}else
{
oTd.innerHTML='<input type="text" />';
}
}
}