<%response.Write request("mysss[]") %>
<html>
<head>
<meta charset="utf-8">
<title>动态创建按钮</title>
<script src='http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js'></script>
<script>
$(document).ready(function() {
var MaxInputs = 3; //maximum input boxes allowed
var InputsWrapper = $("#InputsWrapper"); //Input boxes wrapper ID
var AddButton = $("#AddMoreFileBox"); //Add button ID
var x = InputsWrapper.length; //initlal text box count
var FieldCount=1; //to keep track of text box added
var innerneirong='';
$(AddButton).click(function (e) //on add input button click
{
if(x <= MaxInputs) //max input box allowed
{
FieldCount++; //text box added increment
//add input box
innerneirong='<div><input type="text" name="mysss[]" id="mysss'+FieldCount+'" value="输入收据编号 '+ FieldCount +'"/></div>'
// $(InputsWrapper).append(innerneirong);
$(InputsWrapper).append(innerneirong);
x++; //text box increment
}
return false;
});
$("body").on("click",".removeclass", function(e){ //user click on remove text
if( x > 1 ) {
$(this).parent('div').remove(); //remove text box
x--; //decrement textbox
}
return false;
})
});
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="ta">
<tr>
<td colspan="2" align="left" valign="top" bgcolor="#FFFFFF">
<table width="99%" border="0" cellspacing="2" cellpadding="2" >
<form action="?action=1" method="post" name="form1" id="form1" >
<tr>
<tr>
<td width="14%" height="30" align="right" valign="middle" class="t3"><font color="red">*</font>测试框子:</td>
<td width="52%" height="30" align="left" valign="middle">
<a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" id="AddMoreFileBox" class="btn btn-info">添加更多的input输入框</a>
<div id="InputsWrapper">
<div><input type="text" name="mysss[]" id="mysss1" value="输入收据编号 xxxx" onkeyup="checktishi()" /><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="removeclass"><input type='button' value='删除'></a></div>
</div>
</td>
</tr>
<tr>
<td height="50" colspan="3" align="center" valign="middle"><input name="Submit" type="submit" class="inputbut" value="提交" />
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
我测试的结果mysss[] 一直是“输入收据编号 xxxx”, $(InputsWrapper).append(innerneirong); 这个体现在页面,但request 获取不到值,是怎么回事哦