0

I want to serialize array in a javascript and append the serialized value in form data, I have tried but serialize array showing empty, Kindly give a suggestion.

var IsolationFO = {};
    IsolationFO['tagNumber'] = $('#tagNumberId').val();
    IsolationFO['keyNumber'] = $('#lockProvidedId').val();

var formData = new FormData();
        $.ajax({
            url: baseURL + 'url',
            type: "POST",
            contentType: false,
            processData: false,
            data: function() {

//here the inputs showing empty

var inputs = $('#IsolationFO').serializeArray();
                $.each(inputs, function(i, input) {
                    formData.append(input.name, input.value);
                    console.log("\nSending Data----------------" + input.name + "-----" + input.value);
                });
                return formData;
            }(),
leopal
  • 4,711
  • 1
  • 25
  • 35
MurugananthamS
  • 2,395
  • 4
  • 20
  • 49

0 Answers0