<script type="text/javascript"> function AddZhiwei() { var tab = document.getElementById("zwtab");
for (var i = 0; i < 1; i++) {
var newTr = tab.insertRow(tab.rows.length);
for (var j = 0; j < tab.rows[0].cells.length; j++) {
newTd = newTr.insertCell(j);
}
newTr.cells[0].innerHTML = "<input type='text' name='txtTime'onfocus='WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd'});' Width='100px'/>";
newTr.cells[1].innerHTML = "<input type='text' name='z_text' />";
newTr.cells[2].innerHTML = "<img src='../../images2/icon_add.gif' alt='增加职位信息' onclick='AddZhiwei();' /> <img src='../../images2/icon_delete.gif' onclick='DeleteRow(this)' alt='删除职位信息' />"
}
} </script>
<table id="zwtab" class="mygridview">
<tr class="styleTd1">
<th align="center">
时间
</th>
<th align="center">
职位
</th>
<th align="center">
操作
</th>
</tr>
<tr>
<td>
<input id="txtTime" type="text" name="txtTime" onfocus="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd'});" Width="100px" />
</td>
<td>
<input id="txtzw" type="text" name="z_text" />
</td>
<td>
<img id="imgAdd" runat="server" src="../../images2/icon_add.gif" alt="增加职位信息" onclick="AddZhiwei();" />
<img src="../../images2/icon_delete.gif" onclick="DeleteRow(this)" alt="删除职位信息" />
<input id="hidZW" type="hidden" runat="server" />
</td>
</tr>
</table>
点击增加的时候,报个脚本错误是为什么啊
for (var i = 0; i < 1; i++) {
var newTr = tab.insertRow(tab.rows.length);
for (var j = 0; j < tab.rows[0].cells.length; j++) {
newTd = newTr.insertCell(j);
}
newTr.cells[0].innerHTML = "<input type='text' name='txtTime'onfocus='WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd'});' Width='100px'/>";
newTr.cells[1].innerHTML = "<input type='text' name='z_text' />";
newTr.cells[2].innerHTML = "<img src='../../images2/icon_add.gif' alt='增加职位信息' onclick='AddZhiwei();' /> <img src='../../images2/icon_delete.gif' onclick='DeleteRow(this)' alt='删除职位信息' />"
}
} </script>
<table id="zwtab" class="mygridview">
<tr class="styleTd1">
<th align="center">
时间
</th>
<th align="center">
职位
</th>
<th align="center">
操作
</th>
</tr>
<tr>
<td>
<input id="txtTime" type="text" name="txtTime" onfocus="WdatePicker({skin:'blue',dateFmt:'yyyy-MM-dd'});" Width="100px" />
</td>
<td>
<input id="txtzw" type="text" name="z_text" />
</td>
<td>
<img id="imgAdd" runat="server" src="../../images2/icon_add.gif" alt="增加职位信息" onclick="AddZhiwei();" />
<img src="../../images2/icon_delete.gif" onclick="DeleteRow(this)" alt="删除职位信息" />
<input id="hidZW" type="hidden" runat="server" />
</td>
</tr>
</table>
点击增加的时候,报个脚本错误是为什么啊
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货