0

Before marking it as duplicate ,please read my concern

I have a ajax which post checked checkbox serialized data.I have around 40k checkboxes selected .But when i dumping the serialized data count i am only getting around 20k count.Am i missing anything

var investors=investorDatatable.$("input[name='investors[]']:checked").serializeArray();
    console.log(investorDatatable.$("input[name='investors[]']:checked").length);
    console.log(investors);
    if(investors)
    {
    $('#loader').show();
    $.ajax({
        url: deleteMultipleUrl,
        type: 'POST',
        data:  investors,
        dataType: 'json',
        success: function (data) {
            if (data['status'] = 'success') {
    }

first console ouput is 39862 second console ouput is an array of the 39862 records.

But when i dump the count in the controller it shows 20001

Noobie
  • 99
  • 1
  • 11

1 Answers1

1

Try to send request as FormData and watch how many records transmited. You need to find where your data is cutted.

Nazar
  • 26
  • 4
  • Actually i have situaution that is to send all the selcted checkboxes in the datatble.but i am sending it as formdata .it only posts the checkboxes which are on the DOM not the whole data .That;s why is use investorDatatable.$("input[name='investors[]']:checked").serializeArray() – Noobie May 14 '20 at 09:25
  • Maybe try to add data to FormData manually. Also try to use POST-request (Postman, etc) utility to check if your server can accept so long json. `console.log(JSON.stringify(investors));` and then put it data to POST utility – Nazar May 14 '20 at 09:36
  • when i use JSON.stringify(investors) on console it shows all the dat – Noobie May 14 '20 at 09:52
  • Yep, and then make POST request with this data to url via Postman ([link](https://www.postman.com/)) – Nazar May 14 '20 at 10:06
  • thankyou for the answer when i used the JSON.stringify it works fine. – Noobie May 15 '20 at 09:41