我正在尝试从复选框数组中获取一些值,我收到了这个:
Array ( [0] => [object Object] [1] => [object Object] )
我的复选框来自一个 php 循环:
$vd[]="<input type='checkbox' class='vedere' name='vedere[]' value=".$result['den_vd']."> ".$result['den_vd']."
我的javascript是:
function add_apartament ()
{
var vedere= $('#vedere input[type=checkbox]:checked').serializeArray();
$.ajax({
type: "POST",
url: "inc/ajax/add_apartament_action.php",
data: {
'vedere[]':vedere
},
success: function (msg) {
$("#action").html(msg);
},
error: function (xhr, err) {
alert("readyState: " + xhr.readyState + "\nstatus: " + xhr.status);
alert("responseText: " + xhr.responseText);
}
});
}
现在的问题是:如何从选中的复选框中获取值?
提前致谢!