0

I am using the below code to get all the names of the checkboxes and passing them to download a file from the server, before my edited code i was using window.location.href and it was working well but with few checkboxes, if i send like 400+, it throws an 500 error

here is my code

jq(document).on('click','#downloadAnsdoc',function() {
    var checkedVals = jq('.allchecks:checkbox:checked').map(function() {
        return this.value;
    }).get();
    checkedVals.join(",");
    var iframe = $("<iframe/>").attr({
        src: 'doc/fetch.cfm?action=catAnsDownload&tx_ID='+checkedVals,
        style: "visibility:hidden;display:none"
    });
});

and my previous code was

jq(document).on('click','#downloadAnsdoc',function() {
    var checkedVals = jq('.allchecks:checkbox:checked').map(function() {
        return this.value;
    }).get();
    checkedVals.join(",");
    location.href = 'doc/fetch.cfm?action=catAnsDownload&tx_ID='+checkedVals;
});

the above code was working but passing a big list was creating a problem.

now to solve this, i am trying to send the data as post and make an call to an iframe so it pass all the ids to the database and bring the records and download through an iframe, but my changed method, when i click my button, nothing happens, it does not display any kind of issue, not it does anything

Narsi
  • 11
  • 1

0 Answers0