I have a select box on a page that does a post with jQuery using .ajax and it works great when the select box can only select one value, but when I change it to "multiple" it appends [] to the end of the field姓名。例如,没有多个的 listID 很好,但使用“multiple”作为属性会将名称更改为 listID[]。知道发生了什么吗?
<select multiple size="5" name="frmRecipientList" id="listID">
$.ajax({
url: '/app/components/MailingsReport.cfc',
//POST method is used
type: "POST",
complete: function(){
$("#loader").hide();
},
//pass the data
data: {
method: "createEmailing",
title: $('#title').val(),
campaignID: $('#campaignID').val(),
brandID: $('#brandID').val(),
listID: $('#listID').val(),
maxRecipients: $('#maxRecipients').val(),
subject: $('#subject').val(),
fromName: $('#viewFrom').val(),
testToEmail: $('#testToEmail').val(),
htmlCode: $('#htmlCode').val()
},
dataType: "html",