jquery - bootstrap modal send multiple ajax request includes previous successfull ajax calls -
my code
$("#lead-list .selectboxit").on("change", function() { var st = $( ).val(); var eid = $(this).attr("id"); var id_ar = eid.split("-"); if(st) { $(".modal-body").html("<p>are sure change status of records?</p>"); $('#modal-1').modal('show'); $("#modal-1 .confirm-continue").click(function(event){ $('#modal-1').modal('hide'); jquery.ajax({ type: "post", url: 'ajax-listing-lead-process.php', data: {val: st,id: id_ar[1], action:'update'}, datatype: 'html', success: function (data) { if(data) alert(data); } }); }); } });
i've many select dropdown id status-1, status-2, status-3,...etc. if change status-1, send ajax request values.after change status-2, send ajax request status-1 , status-2 respective values. further changing status-3, send ajax request status-1, status-2 , status-3 respective values.
how send ajax request changed element value , avoid resending previous ajax requests.
note: works fine without modal-confirmation dialogue box.
Comments
Post a Comment