Struggling with sending an array via Ajax to PHP.
For more information, visit jsfiddle https://jsfiddle.net/CraigDavison/9spyn7ah/
function autoPopulate() {
var cast = "John Wayne, Julia Roberts, Kevin Spacey";
cast = cast.split(', ');
var arr_cast = [];
$.each(cast, function() {
arr_cast.push(this);
});
return_ajax_result('app/handlers/get_cast_ids.php', {cast: arr_cast});
}
Aiming to convert a string of movie actors into an array. This list should be associated with "Cast" as cast=[actor 1, actor 2, actor 3].
The issue arises when attempting to append this to the formData because it remains empty.
Would appreciate any insights on this matter. Thank you!