<form action="test.php" method="post">
<input type="text" name="pic[]" value="1">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="6">
<input type="submit" value="提交" />
</form>就像这样的。AJAX下面如何取呢?
<input type="text" name="pic[]" value="1">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="6">
<input type="submit" value="提交" />
</form>就像这样的。AJAX下面如何取呢?
解决方案 »
- 请高手帮我解决 在先等JS
- jsp表单不能嵌套吗
- 请帮帮我,我想控制一个页面内显示的内容怎么做
- 如何用javascript实现选择编码
- 共享几行代码。
- 什么工具写javascript有对象属性提示的?
- ie提示语法错误,但是在其他浏览器没错
- javascript下载文件问题
- jQuery1.4 中逐个修改一句话中各个字的字体大小
- 能够把下面的input中的值取出来吗(高手请回答)
- jquery中siblings的疑问,以及asp.net中服务器控件id命名的限制
- 用正则表达式 替换字符串 {asd}niasd{asdasd}217{12ex} 中 {%}中的参数 为<input> 字符串是传过来的参数
<form action="test.php" method="post">
<input type="text" name="pic[]" value="1">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="6">
<input type="submit" value="提交" />
</form>
<script>
$(function () {
alert($.param($('input[name="pic[]"]')))
});
</script>
$("input[name='pic[]']").each(function(){
alert($(this).val());
})
jquery$("input[name='pic']").val();取得以,分隔的字符串
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script>
$(function () { $("#btnSubmit").live("click", function () {
var values = [];
$("input:[name='pic[]']").each(function () {
values.push($(this).val());
});
values = values.join(",");
$.ajax({
url: 'Default.aspx',
data: { pic: values },
success: function (data) {
//你的操作
}
});
}); });
</script>
</head>
<body>
<form action="test.php" method="post">
<input type="text" name="pic[]" value="1">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="4">
<input type="text" name="pic[]" value="5">
<input type="text" name="pic[]" value="6">
<input type="button" id="btnSubmit" value="提交" />
</form>
</body>
</html>
$.ajax({
type: "GET",
url: "some.php",
data: $("form").serialize(),
success: function(msg){
}
});