0

I have many input type of checkbox in my html page. Those checkbox are checked by user must be sent to server but not in the burst way. I mean for example, user checks 10 inputs, the first one is sent to the server waiting for the first response, then second send, and so on ... . My problem is at the first time all the input sent without being waited for the first response.

I'm using jquery and php localhost

$(document).on('click', '[data-snapshots="run"]', function(){
                    var jParent = $('#AllDiagramsInProjectModal');
                    var jSelf = $(this);
                    jParent.find('[data-get-snapshot-diagram-id]').each(function(i,v) {
                        var nDiagrams= [];
                        if ($(v).prop('checked') === true) {

                            DiagId = $(v).attr('data-get-snapshot-diagram-id');
                            SnapProjectId = $(v).attr('data-spanshot-project-id');

                            console.log("Running all snapshot (" + DiagId + "," + SnapProjectId + ")");
                            //make_an_ajax_call(DiagId, SnapProjectId);
                        }
                    });

                });

1 Answers1

0

You need to manage your ajax calls as explained here on jAndy Answered: Queue ajax requests using jQuery.queue()

ajafari
  • 183
  • 1
  • 10