按一个按钮,增加下面的一个tr,也可删除
这个问题比较难,大家有什么指点?
<tr >
<td style="height:30px; width:18px;"></td>
<td bgcolor="#F3F4F6" style="height:30px; width:202px;" align="left">
導師1員工編號 </td>
<td style="height:30px; width:16px;">:</td>
<td align="left" style="height:30px; width:236px;">
<asp:TextBox ID="txtEmpno1" onkeydown="enter()" runat="server" Width="184px" MaxLength="8"></asp:TextBox><img id="Img4" runat="server" align="absMiddle" alt="選擇工號" height="20" onclick="window.open('BrowseEmployee.aspx?currcontrolid=2'+'&facnum='+$F('SelFacNum')+'&deptnum='+$F('SelDeptNum') ,'win01','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=850,height=500,top='+(screen.height-380)/2+',left='+(screen.width-800)/2)"
onmouseover="this.style.cursor='hand'" src="images/cmdBrowse.gif" width="21" /></td>
<td >
<strong><span style="color: #ff0000"></span></strong></td>
<td bgcolor="#F3F4F6" style="height:30px; width:202px;" align="left">
導師1名稱 </td>
<td style="height:30px; width:3px;">:</td>
<td align="left" style="height:30px; width:245px;">
<asp:textbox id="lblNamChn1" onkeydown="enter()" runat="server" Width="192px"
CssClass="Border" MaxLength="20"></asp:textbox>
</td>
</tr>
解决方案 »
- 左右移动的图片要怎么做?
- C#中用日期+3位数字生成序列号
- check问题------ 为什么点击关闭按钮也check!
- 【请教】给img元素添加error属性的问题。thumbImg.setAttribute("onerror",error)
- 关于服务器控件调用JS的问题
- 怎么把HTML页面输入到aspx页面的某个位置
- 100分,求未能加载文件或程序集的错误的解决方法
- 谁有《专家门诊——ASP.NET开发答疑200问》这本书的随书全套代码????
- 如何将datagrid中的数据,另存到SQL2000中或Access中(使用C#)
- mvc怎么得到 html.listbox 中的所有item
- 表格关联问题
- 模式对话框动态传值问题
也可以在服务端,使用asp:table控件,然后往里面扔TableRow,--建议看一下 Table TableRow TableCell这三个类。非常方便实用
那你想干什么,想增加服务器端的控件???那你的table就用<asp:table>
<script>
var attIndex=0;function adddiv(){
var attDiv = document.createElement("div");
attDiv.innerHTML = "测试"+attIndex;
attDiv.id="attDiv_"+attIndex;
document.body.appendChild(attDiv);
var attDel = document.createElement("a");
attDel.id = "attlink_" + attIndex;
attDel.href = "#";
attDel.innerHTML = "删除";
attDel.onclick = function() { document.body.removeChild(attDiv);}
attDiv.appendChild(attDel);
attIndex++ ;
}
</script>
<input type="button" value="增加" onclick="adddiv()">
楼上已经给例子了这里就不再贴代码了,都差不多的