我有文本框数组
<input type="text" name="txt[]" id"txt[]" value="test 1" />
<input type="text" name="txt[]" id"txt[]" value="test 2" />
<input type="text" name="txt[]" id"txt[]" value="test 3" />
并想使用 jquery 将此数组发布到 php 文件:
$('#submit').click(function() {
$.ajax({
type : 'POST',
url : '<?php echo site_url('projects/create'); ?>',
data: {
txt: $('#txt').val()
},
success:function (data) {
$("#log_msg").html(data);
}
});
});
但它返回undefined