0

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",
4

1 回答 1

0

listID<select multiple>。这意味着可以有多个值。[]使它成为一个数组,因此在服务器上,它可以读取所有值。

于 2012-06-27T19:53:56.207 回答