用表单,然后subimt之后,用request["contact"]获取
解决方案 »
- 无论指定什么端口asp.net都提示被占用
- 定时刷新的问题
- 后台代码事件有没有类似BODY的UNLOAD事?
- SESSION和MSSQL服务器性能问题。
- 试图运行的项目时出错:无法在web服务器上启动调试
- AspNetPager分页控件怎实现查询分页???
- vs.net2.0的布局问题啊 新来的帮帮我啊
- 用户控件内的DataList分页,该如何实现?
- 如何在.aspx文件中使用javascript脚本?
- 难题:怎样从弹出的Model窗口获取大量数据?有请各路英雄解答~~
- 求助!asp.net mvc3做的项目在本地iis7上运行正常,可是在windows server 2003 的iis6上ajax不能用了!
- 求助!!IIS中预览出现未能加载“Interop.MSXML2”
新增了后,可能会删除掉中间的一行,这时候name名称就不是连续的了
新增了后,可能会删除掉中间的一行,这时候name名称就不是连续的了
不想用JS的话也有办法,循环取值的时候加个判断就行了..
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script>
var allCount;
allCount = 1;
function addLinkMan() { allCount++;
var newRow, F1, F2, F3, F4, S1, S2, S3, S4;
var rown = filetb.rows.length; newRow = filetb.insertRow(rown);
newRow.id = "tds" + allCount;
newRow.name = "tds" + allCount; S1 = newRow.insertCell(0);
S1.width = "90";
S1.className = "head1_black style1"; S1.innerHTML = "联系人"; S2 = newRow.insertCell(1);
S2.innerHTML = " <input id=phone" + allCount + " name=phone" + allCount + " type='text' style='width: 130px;'/>"; S3 = newRow.insertCell(2);
S3.width = "90";
S3.className = "head1_black style1";
S3.innerHTML = "职位"; S4 = newRow.insertCell(3);
var temp = "support" + allCount;
S4.innerHTML = " <input id=support" + allCount + " name=support" + allCount + " type='text' style='width: 100px;' onchange=yzSupport('" + temp + "'); />%<img src='images/del.gif' style='cursor:pointer;' width='15' height='15' onclick=removeLinkMan(" + allCount + "); alt='删除当前联系人' />"; newRow = filetb.insertRow(rown);
newRow.id = "tdf" + allCount;
newRow.name = "tdf" + allCount; F1 = newRow.insertCell(0);
F1.width = "90";
F1.className = "head1_black style1";
F1.innerHTML = "联系人"; F2 = newRow.insertCell(1);
F2.innerHTML = " <input id=linkmanName" + allCount + " name=linkmanName" + allCount + " type='text' style='width: 130px;'/>"; F3 = newRow.insertCell(2);
F3.width = "90";
F3.className = "head1_black style1";
F3.innerHTML = "职位"; F4 = newRow.insertCell(3);
F4.innerHTML = " <input id=position" + allCount + " name=position" + allCount + " type='text' style='width: 130px;'/>";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" onclick="addLinkMan()" />
<table id="filetb">
<tr>
<td>
</td>
</tr>
</table>
</div> </form>
</body>
</html>
{
var result = "";
var inputs = $("#div").find("input");
for(var i=0;i<inputs.length;i++)
{
result = result + inputs[i].val();
}
$("#hiddenText").val(result+",");
}然后在后台取这个文本域的值就可以了。个人想法。