0

So when I try to read the variable on complete with papaparse i get the following error: TypeError: wpcc_results is undefined.

I really cannot see what is wrong with my code here:

$('.wpcc_gen_box_form').submit(function(event) {
                    // stop the form from submitting the normal way and refreshing the page    
                    event.preventDefault();

                    $('#wpcc_csv_file').parse({
                        complete: function(wpcc_results) {
                            console.log(wpcc_results.data);
                        }
     });
});

I think fresh eyes would really help here.

I appreciate any help.

Tapha
  • 1,491
  • 3
  • 17
  • 32

1 Answers1

1

The solution is in fact to define the complete function within the config. As that is where the parameters are actually passed. Answer was found here: https://github.com/mholt/PapaParse/issues/168

Tapha
  • 1,491
  • 3
  • 17
  • 32