我正在尝试遍历每个表单字段的无序列表。当我尝试将其附加到 formdata 并通过 PHP 处理它时,它只会返回
team: "[object Object],[object Object]"
JS在这里:
var arr = [];
$( '#team_list li' ).each(function(idx, li) {
$team_name = $( li ).find('input[name="team_name"]').val();
$team_role = $( li ).find('input[name="team_role"]').val();
$team_citizen = $( li ).find('#country').val();
$team_status = $( li ).find('#id_team_status').val();
arr.push({ name: $team_name, role: $team_role, citizen: $team_citizen, status: $team_status, });
});
fd.append('team', arr );
达令说