<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Jquery动态控件</title>
<script src="jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(
function() {
var i = 2;
$(
'#addText').click(function() {
if (i < 9) {
$(
'#main').append('<div><input type="text" name="text" + i + ""/>
                        <a href="#" class="del-text">del</a></div>
');
i
++;
}
else {
alert(
"最多只能添加8个");
}
});
$(
'.del-text').live('click',function(){
$(
this).parent().remove();
i
--;
});
});
</script>
</head>
<body>
<div id="main">
<div>
<input type="text" name="text1" />
</div>
</div>
<a id="addText" href="#">添加文本框</a>
</body>
</html>

==========

取值的话,很简单,在后台直接用 Request["text" + i].ToString() 即可。

相关文章:

  • 2022-03-03
  • 2021-10-24
  • 2022-12-23
  • 2021-09-25
  • 2021-05-12
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-01-18
  • 2021-09-16
  • 2022-12-23
  • 2021-10-10
  • 2021-07-05
相关资源
相似解决方案