【发布时间】:2014-05-09 01:25:24
【问题描述】:
我正在使用 jQuery multiSelect 并希望将选择传递给我的更新脚本。
这是我的 ajax 调用
var newnotesecurity = $("#nt_newnotesecurity").serializeArray();
$.ajax({
url: 'notes-savenewnote.php',
method: 'POST',
data: {
cache: false,
companyid: companyid,
entitytype: entitytype,
entityid: entityid,
noteinitials: newnoteinitials,
notetext: newnotetext,
notetags: newnotetags,
notesecurity: newnotesecurity
},
success: function() {
// blah
},
error: function(){
// blah
}
});
nt_newnotesecurity 是多选对象。显然 serializeArray 不适合我。这只是我最近的一次尝试。
我最终传递了这个:
notesecurity[0][name]=nt_newnotesecurity&
notesecurity[0][value]=2&
notesecurity[1][name]=nt_newnotesecurity&
notesecurity[1][value]=14
但我想传递这个
nt_newnotesecurity=2&nt_newnotesecurity=14
或者我会满足于传递一个我以后可以爆炸的值,就像这样
notesecurity=2-14
【问题讨论】:
标签: jquery ajax jquery-multiselect